Fix dailymotion with not-found URL.
This commit is contained in:
parent
7a0aad5e8f
commit
555463c7ae
1 changed files with 5 additions and 1 deletions
|
|
@ -82,7 +82,11 @@ class VideoPage(BasePage):
|
||||||
if 'id' in script.attrib and script.attrib['id'].startswith('container_player_'):
|
if 'id' in script.attrib and script.attrib['id'].startswith('container_player_'):
|
||||||
text = script.find('script').text
|
text = script.find('script').text
|
||||||
mobj = re.search(r'(?i)addVariable\(\"video\"\s*,\s*\"([^\"]*)\"\)', text)
|
mobj = re.search(r'(?i)addVariable\(\"video\"\s*,\s*\"([^\"]*)\"\)', text)
|
||||||
mediaURL = urllib.unquote(mobj.group(1))
|
if mobj is None:
|
||||||
|
mobj = re.search('"sdURL":.*?"(.*?)"', urllib.unquote(text))
|
||||||
|
mediaURL = mobj.group(1).replace("\\", "")
|
||||||
|
else:
|
||||||
|
mediaURL = urllib.unquote(mobj.group(1))
|
||||||
video.url = mediaURL
|
video.url = mediaURL
|
||||||
|
|
||||||
return video
|
return video
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue