Merge pull request #9288 from reyyed/issue#9063fix
[youtube-dl] / youtube_dl / extractor / biqle.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 from .common import InfoExtractor
5
6
7 class BIQLEIE(InfoExtractor):
8     _VALID_URL = r'https?://(?:www\.)?biqle\.(?:com|org|ru)/watch/(?P<id>-?\d+_\d+)'
9     _TESTS = [{
10         'url': 'http://www.biqle.ru/watch/847655_160197695',
11         'md5': 'ad5f746a874ccded7b8f211aeea96637',
12         'info_dict': {
13             'id': '160197695',
14             'ext': 'mp4',
15             'title': 'Foo Fighters - The Pretender (Live at Wembley Stadium)',
16             'uploader': 'Andrey Rogozin',
17             'upload_date': '20110605',
18         }
19     }, {
20         'url': 'https://biqle.org/watch/-44781847_168547604',
21         'md5': '7f24e72af1db0edf7c1aaba513174f97',
22         'info_dict': {
23             'id': '168547604',
24             'ext': 'mp4',
25             'title': 'Ребенок в шоке от автоматической мойки',
26             'uploader': 'Dmitry Kotov',
27         }
28     }]
29
30     def _real_extract(self, url):
31         video_id = self._match_id(url)
32         webpage = self._download_webpage(url, video_id)
33         embed_url = self._proto_relative_url(self._search_regex(
34             r'<iframe.+?src="((?:http:)?//daxab\.com/[^"]+)".*?></iframe>', webpage, 'embed url'))
35
36         return {
37             '_type': 'url_transparent',
38             'url': embed_url,
39         }