Fix fail to download audio file when tha query word like 'Spotify'(First character is capital) from longman.
This commit is contained in:
parent
47a73a0657
commit
63be2a8d84
@ -6,7 +6,6 @@ from bs4 import Tag
|
|||||||
from ..base import *
|
from ..base import *
|
||||||
from ...utils.misc import format_multi_query_word
|
from ...utils.misc import format_multi_query_word
|
||||||
|
|
||||||
|
|
||||||
longman_download_mp3 = True
|
longman_download_mp3 = True
|
||||||
longman_download_img = True
|
longman_download_img = True
|
||||||
|
|
||||||
@ -30,8 +29,8 @@ class Longman(WebService):
|
|||||||
assert isinstance(dic_link, Tag)
|
assert isinstance(dic_link, Tag)
|
||||||
|
|
||||||
# remove sound tag
|
# remove sound tag
|
||||||
am_s_tag = dic_link.find('span', title='Play American pronunciation of {}'.format(self.word))
|
am_s_tag = dic_link.find('span', {'class': 'speaker amefile fa fa-volume-up hideOnAmp'})
|
||||||
br_s_tag = dic_link.find('span', title='Play British pronunciation of {}'.format(self.word))
|
br_s_tag = dic_link.find('span', {'class': 'speaker brefile fa fa-volume-up hideOnAmp'})
|
||||||
if am_s_tag:
|
if am_s_tag:
|
||||||
word_info['am_mp3'] = am_s_tag.get('data-src-mp3', u'')
|
word_info['am_mp3'] = am_s_tag.get('data-src-mp3', u'')
|
||||||
am_s_tag.decompose()
|
am_s_tag.decompose()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user