@ -1,22 +1,22 @@
from __future__ import unicode_literals
import re
import re
import json
import json
from . common import InfoExtractor
from . common import InfoExtractor
from . . utils import (
determine_ext ,
)
class VeohIE ( InfoExtractor ) :
class VeohIE ( InfoExtractor ) :
_VALID_URL = r ' http://(?:www \ .)?veoh \ .com/(?:watch|iphone/#_Watch)/v(?P<id> \ d*) '
_VALID_URL = r ' http://(?:www \ .)?veoh \ .com/(?:watch|iphone/#_Watch)/v(?P<id> \ d*) '
_TEST = {
_TEST = {
u ' url ' : u ' http://www.veoh.com/watch/v56314296nk7Zdmz3 ' ,
' url ' : ' http://www.veoh.com/watch/v56314296nk7Zdmz3 ' ,
u ' file ' : u ' 56314296.mp4 ' ,
' file ' : ' 56314296.mp4 ' ,
u ' md5 ' : u ' 620e68e6a3cff80086df3348426c9ca3 ' ,
' md5 ' : ' 620e68e6a3cff80086df3348426c9ca3 ' ,
u ' info_dict ' : {
' info_dict ' : {
u ' title ' : u ' Straight Backs Are Stronger ' ,
' title ' : ' Straight Backs Are Stronger ' ,
u ' uploader ' : u ' LUMOback ' ,
' uploader ' : ' LUMOback ' ,
u ' description ' : u ' At LUMOback, we believe straight backs are stronger. The LUMOback Posture & Movement Sensor: It gently vibrates when you slouch, inspiring improved posture and mobility. Use the app to track your data and improve your posture over time. ' ,
' description ' : ' At LUMOback, we believe straight backs are stronger. The LUMOback Posture & Movement Sensor: It gently vibrates when you slouch, inspiring improved posture and mobility. Use the app to track your data and improve your posture over time. ' ,
}
}
}
}
@ -28,7 +28,7 @@ class VeohIE(InfoExtractor):
m_youtube = re . search ( r ' http://www \ .youtube \ .com/v/(.*?)( \ &| " ) ' , webpage )
m_youtube = re . search ( r ' http://www \ .youtube \ .com/v/(.*?)( \ &| " ) ' , webpage )
if m_youtube is not None :
if m_youtube is not None :
youtube_id = m_youtube . group ( 1 )
youtube_id = m_youtube . group ( 1 )
self . to_screen ( u ' %s : detected Youtube video. ' % video_id )
self . to_screen ( ' %s : detected Youtube video. ' % video_id )
return self . url_result ( youtube_id , ' Youtube ' )
return self . url_result ( youtube_id , ' Youtube ' )
self . report_extraction ( video_id )
self . report_extraction ( video_id )
@ -36,9 +36,9 @@ class VeohIE(InfoExtractor):
info = json . loads ( info )
info = json . loads ( info )
video_url = info . get ( ' fullPreviewHashHighPath ' ) or info . get ( ' fullPreviewHashLowPath ' )
video_url = info . get ( ' fullPreviewHashHighPath ' ) or info . get ( ' fullPreviewHashLowPath ' )
return { ' id ' : info [ ' videoId ' ] ,
return {
' id ' : info [ ' videoId ' ] ,
' title ' : info [ ' title ' ] ,
' title ' : info [ ' title ' ] ,
' ext ' : determine_ext ( video_url ) ,
' url ' : video_url ,
' url ' : video_url ,
' uploader ' : info [ ' username ' ] ,
' uploader ' : info [ ' username ' ] ,
' thumbnail ' : info . get ( ' highResImage ' ) or info . get ( ' medResImage ' ) ,
' thumbnail ' : info . get ( ' highResImage ' ) or info . get ( ' medResImage ' ) ,