]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/xfileshare.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
18 class XFileShareIE(InfoExtractor
):
19 IE_DESC
= 'XFileShare based sites: GorillaVid.in, daclips.in, movpod.in, fastvideo.in, realvid.net, filehoot.com and vidto.me'
21 https?://(?P<host>(?:www\.)?
22 (?:daclips\.in|gorillavid\.in|movpod\.in|fastvideo\.in|realvid\.net|filehoot\.com|vidto\.me))/
23 (?:embed-)?(?P<id>[0-9a-zA-Z]+)(?:-[0-9]+x[0-9]+\.html)?
26 _FILE_NOT_FOUND_REGEX
= r
'>(?:404 - )?File Not Found<'
29 'url': 'http://gorillavid.in/06y9juieqpmi',
30 'md5': '5ae4a3580620380619678ee4875893ba',
34 'title': 'Rebecca Black My Moment Official Music Video Reaction-6GK87Rc8bzQ',
35 'thumbnail': 're:http://.*\.jpg',
38 'url': 'http://gorillavid.in/embed-z08zf8le23c6-960x480.html',
39 'only_matching': True,
41 'url': 'http://daclips.in/3rso4kdn6f9m',
42 'md5': '1ad8fd39bb976eeb66004d3a4895f106',
46 'title': 'Micro Pig piglets ready on 16th July 2009-bG0PdrCdxUc',
47 'thumbnail': 're:http://.*\.jpg',
50 # video with countdown timeout
51 'url': 'http://fastvideo.in/1qmdn1lmsmbw',
52 'md5': '8b87ec3f6564a3108a0e8e66594842ba',
56 'title': 'Man of Steel - Trailer',
57 'thumbnail': 're:http://.*\.jpg',
60 'url': 'http://realvid.net/ctn2y6p2eviw',
61 'md5': 'b2166d2cf192efd6b6d764c18fd3710e',
66 'thumbnail': 're:http://.*\.jpg',
69 'url': 'http://movpod.in/0wguyyxi1yca',
70 'only_matching': True,
72 'url': 'http://filehoot.com/3ivfabn7573c.html',
76 'title': 'youtube-dl test video \'äBaW_jenozKc.mp4.mp4',
77 'thumbnail': 're:http://.*\.jpg',
80 'url': 'http://vidto.me/ku5glz52nqe1.html',
88 def _real_extract(self
, url
):
89 mobj
= re
.match(self
._VALID
_URL
, url
)
90 video_id
= mobj
.group('id')
92 url
= 'http://%s/%s' % (mobj
.group('host'), video_id
)
93 webpage
= self
._download
_webpage
(url
, video_id
)
95 if re
.search(self
._FILE
_NOT
_FOUND
_REGEX
, webpage
) is not None:
96 raise ExtractorError('Video %s does not exist' % video_id
, expected
=True)
98 fields
= self
._hidden
_inputs
(webpage
)
100 if fields
['op'] == 'download1':
101 countdown
= int_or_none(self
._search
_regex
(
102 r
'<span id="countdown_str">(?:[Ww]ait)?\s*<span id="cxc">(\d+)</span>\s*(?:seconds?)?</span>',
103 webpage
, 'countdown', default
=None))
105 self
._sleep
(countdown
, video_id
)
107 post
= compat_urllib_parse
.urlencode(encode_dict(fields
))
109 req
= compat_urllib_request
.Request(url
, post
)
110 req
.add_header('Content-type', 'application/x-www-form-urlencoded')
112 webpage
= self
._download
_webpage
(req
, video_id
, 'Downloading video page')
114 title
= (self
._search
_regex
(
115 [r
'style="z-index: [0-9]+;">([^<]+)</span>',
116 r
'<td nowrap>([^<]+)</td>',
118 r
'<h2 class="video-page-head">([^<]+)</h2>'],
119 webpage
, 'title', default
=None) or self
._og
_search
_title
(webpage
)).strip()
120 video_url
= self
._search
_regex
(
121 [r
'file\s*:\s*["\'](http
[^
"\']+)["\'],',
122 r'file_link\s
*=\s
*\'(https?
:\
/\
/[0-9a
-zA
-z
.\
/\
-_
]+)'],
124 thumbnail = self._search_regex(
125 r'image\s
*:\s
*["\'](http[^"\']+)["\'],', webpage, 'thumbnail', default=None)
136 'thumbnail': thumbnail,