[ie/facebook] Support more groups URLs (#11576)
[yt-dlp3.git] / yt_dlp / extractor / godtube.py
blobf4496ac5d8f5144fb01e5f202a5580e2ee41f08d
1 from .common import InfoExtractor
2 from ..utils import (
3 parse_duration,
4 parse_iso8601,
8 class GodTubeIE(InfoExtractor):
9 _WORKING = False
10 _VALID_URL = r'https?://(?:www\.)?godtube\.com/watch/\?v=(?P<id>[\da-zA-Z]+)'
11 _TESTS = [
13 'url': 'https://www.godtube.com/watch/?v=0C0CNNNU',
14 'md5': '77108c1e4ab58f48031101a1a2119789',
15 'info_dict': {
16 'id': '0C0CNNNU',
17 'ext': 'mp4',
18 'title': 'Woman at the well.',
19 'duration': 159,
20 'timestamp': 1205712000,
21 'uploader': 'beverlybmusic',
22 'upload_date': '20080317',
23 'thumbnail': r're:^https?://.*\.jpg$',
28 def _real_extract(self, url):
29 mobj = self._match_valid_url(url)
30 video_id = mobj.group('id')
32 config = self._download_xml(
33 f'http://www.godtube.com/resource/mediaplayer/{video_id.lower()}.xml',
34 video_id, 'Downloading player config XML')
36 video_url = config.find('file').text
37 uploader = config.find('author').text
38 timestamp = parse_iso8601(config.find('date').text)
39 duration = parse_duration(config.find('duration').text)
40 thumbnail = config.find('image').text
42 media = self._download_xml(
43 f'http://www.godtube.com/media/xml/?v={video_id}', video_id, 'Downloading media XML')
45 title = media.find('title').text
47 return {
48 'id': video_id,
49 'url': video_url,
50 'title': title,
51 'thumbnail': thumbnail,
52 'timestamp': timestamp,
53 'uploader': uploader,
54 'duration': duration,