X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Findavideo.py;h=11cf3c60964fe55c21282ecccf48a7d80ae4bac5;hb=ec85ded83cbfa652ba94cb080aab52d8b270212a;hp=b7571524457d44eecc5b319f879220b9944d3929;hpb=3c12a027d48a2d6d1162ab515df0308237aef881;p=youtube-dl diff --git a/youtube_dl/extractor/indavideo.py b/youtube_dl/extractor/indavideo.py index b75715244..11cf3c609 100644 --- a/youtube_dl/extractor/indavideo.py +++ b/youtube_dl/extractor/indavideo.py @@ -1,7 +1,6 @@ # coding: utf-8 from __future__ import unicode_literals -from .. import utils from .common import InfoExtractor from ..utils import ( int_or_none, @@ -20,7 +19,7 @@ class IndavideoEmbedIE(InfoExtractor): 'ext': 'mp4', 'title': 'Cicatánc', 'description': '', - 'thumbnail': 're:^https?://.*\.jpg$', + 'thumbnail': r're:^https?://.*\.jpg$', 'uploader': 'cukiajanlo', 'uploader_id': '83729', 'timestamp': 1439193826, @@ -44,7 +43,6 @@ class IndavideoEmbedIE(InfoExtractor): 'http://amfphp.indavideo.hu/SYm0json.php/player.playerHandler.getVideoData/%s' % video_id, video_id)['data'] - video_id = video['id'] title = video['title'] video_urls = video.get('video_files', []) @@ -62,7 +60,8 @@ class IndavideoEmbedIE(InfoExtractor): formats = [{ 'url': video_url, - 'height': self._search_regex(r'\.(\d{3,4})\.mp4$', video_url, 'height', default=None), + 'height': int_or_none(self._search_regex( + r'\.(\d{3,4})\.mp4(?:\?|$)', video_url, 'height', default=None)), } for video_url in video_urls] self._sort_formats(formats) @@ -75,10 +74,10 @@ class IndavideoEmbedIE(InfoExtractor): 'url': self._proto_relative_url(thumbnail) } for thumbnail in video.get('thumbnails', [])] - tags = [tag['title'] for tag in video.get('tags', [])] + tags = [tag['title'] for tag in video.get('tags') or []] return { - 'id': video_id, + 'id': video.get('id') or video_id, 'title': title, 'description': video.get('description'), 'thumbnails': thumbnails, @@ -93,8 +92,8 @@ class IndavideoEmbedIE(InfoExtractor): class IndavideoIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?indavideo\.hu/video/(?P[^/#?]+)' - _TEST = { + _VALID_URL = r'https?://(?:.+?\.)?indavideo\.hu/video/(?P[^/#?]+)' + _TESTS = [{ 'url': 'http://indavideo.hu/video/Vicces_cica_1', 'md5': '8c82244ba85d2a2310275b318eb51eac', 'info_dict': { @@ -103,7 +102,7 @@ class IndavideoIE(InfoExtractor): 'ext': 'mp4', 'title': 'Vicces cica', 'description': 'Játszik a tablettel. :D', - 'thumbnail': 're:^https?://.*\.jpg$', + 'thumbnail': r're:^https?://.*\.jpg$', 'uploader': 'Jet_Pack', 'uploader_id': '491217', 'timestamp': 1390821212, @@ -112,7 +111,22 @@ class IndavideoIE(InfoExtractor): 'age_limit': 0, 'tags': ['vicces', 'macska', 'cica', 'ügyes', 'nevetés', 'játszik', 'Cukiság', 'Jet_Pack'], }, - } + }, { + 'url': 'http://index.indavideo.hu/video/2015_0728_beregszasz', + 'only_matching': True, + }, { + 'url': 'http://auto.indavideo.hu/video/Sajat_utanfutoban_a_kis_tacsko', + 'only_matching': True, + }, { + 'url': 'http://erotika.indavideo.hu/video/Amator_tini_punci', + 'only_matching': True, + }, { + 'url': 'http://film.indavideo.hu/video/f_hrom_nagymamm_volt', + 'only_matching': True, + }, { + 'url': 'http://palyazat.indavideo.hu/video/Embertelen_dal_Dodgem_egyuttes', + 'only_matching': True, + }] def _real_extract(self, url): display_id = self._match_id(url)