]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/veoh.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
12 class VeohIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?veoh\.com/(?:watch|videos|embed|iphone/#_Watch)/(?P<id>(?:v|e|yapi-)[\da-zA-Z]+)'
16 'url': 'http://www.veoh.com/watch/v56314296nk7Zdmz3',
17 'md5': '620e68e6a3cff80086df3348426c9ca3',
19 'id': 'v56314296nk7Zdmz3',
21 'title': 'Straight Backs Are Stronger',
22 'description': 'md5:203f976279939a6dc664d4001e13f5f4',
23 'thumbnail': 're:https://fcache\\.veoh\\.com/file/f/th56314296\\.jpg(\\?.*)?',
24 'uploader': 'LUMOback',
27 'average_rating': int,
30 'categories': ['technology_and_gaming'],
31 'tags': ['posture', 'posture', 'sensor', 'back', 'pain', 'wearable', 'tech', 'lumo'],
34 'url': 'http://www.veoh.com/embed/v56314296nk7Zdmz3',
35 'only_matching': True,
37 'url': 'http://www.veoh.com/watch/v27701988pbTc4wzN?h1=Chile+workers+cover+up+to+avoid+skin+damage',
38 'md5': '4a6ff84b87d536a6a71e6aa6c0ad07fa',
42 'title': 'Chile workers cover up to avoid skin damage',
43 'description': 'md5:2bd151625a60a32822873efc246ba20d',
44 'uploader': 'afp-news',
47 'skip': 'This video has been deleted.',
49 'url': 'http://www.veoh.com/watch/v69525809F6Nc4frX',
50 'md5': '4fde7b9e33577bab2f2f8f260e30e979',
51 'note': 'Embedded ooyala video',
55 'title': 'Doctors Alter Plan For Preteen\'s Weight Loss Surgery',
56 'description': 'md5:f5a11c51f8fb51d2315bca0937526891',
57 'uploader': 'newsy-videos',
59 'skip': 'This video has been deleted.',
61 'url': 'http://www.veoh.com/watch/e152215AJxZktGS',
62 'only_matching': True,
64 'url': 'https://www.veoh.com/videos/v16374379WA437rMH',
65 'md5': 'cceb73f3909063d64f4b93d4defca1b3',
67 'id': 'v16374379WA437rMH',
69 'title': 'Phantasmagoria 2, pt. 1-3',
70 'description': 'Phantasmagoria: a Puzzle of Flesh',
71 'thumbnail': 're:https://fcache\\.veoh\\.com/file/f/th16374379\\.jpg(\\?.*)?',
72 'uploader': 'davidspackage',
75 'average_rating': int,
78 'categories': ['technology_and_gaming', 'gaming'],
79 'tags': ['puzzle', 'of', 'flesh'],
83 def _real_extract(self
, url
):
84 video_id
= self
._match
_id
(url
)
85 metadata
= self
._download
_json
(
86 'https://www.veoh.com/watch/getVideo/' + video_id
,
88 video
= metadata
['video']
89 title
= video
['title']
92 q
= qualities(['Regular', 'HQ'])
94 for f_id
, f_url
in video
.get('src', {}).items():
105 self
._sort
_formats
(formats
)
107 categories
= metadata
.get('categoryPath')
109 category
= try_get(video
, lambda x
: x
['category'].strip().removeprefix('category_'))
110 categories
= [category
] if category
else None
111 tags
= video
.get('tags')
116 'description': video
.get('description'),
117 'thumbnail': thumbnail_url
,
118 'uploader': video
.get('author', {}).get('nickname'),
119 'duration': int_or_none(video
.get('lengthBySec')) or parse_duration(video
.get('length')),
120 'view_count': int_or_none(video
.get('views')),
122 'average_rating': int_or_none(video
.get('rating')),
123 'comment_count': int_or_none(video
.get('numOfComments')),
124 'age_limit': 18 if video
.get('contentRatingId') == 2 else 0,
125 'categories': categories
,
126 'tags': tags
.split(', ') if tags
else None,