[^&]+)'
8 | _TESTS = [{
9 | 'url': 'http://www.worldstarhiphop.com/videos/video.php?v=wshh6a7q1ny0G34ZwuIO',
10 | 'md5': '9d04de741161603bf7071bbf4e883186',
11 | 'info_dict': {
12 | 'id': 'wshh6a7q1ny0G34ZwuIO',
13 | 'ext': 'mp4',
14 | 'title': 'KO Of The Week: MMA Fighter Gets Knocked Out By Swift Head Kick!'
15 | }
16 | }, {
17 | 'url': 'http://m.worldstarhiphop.com/android/video.php?v=wshh6a7q1ny0G34ZwuIO',
18 | 'only_matching': True,
19 | }]
20 |
21 | def _real_extract(self, url):
22 | video_id = self._match_id(url)
23 | webpage = self._download_webpage(url, video_id)
24 |
25 | entries = self._parse_html5_media_entries(url, webpage, video_id)
26 |
27 | if not entries:
28 | return self.url_result(url, 'Generic')
29 |
30 | title = self._html_search_regex(
31 | [r'(?s)\s*
(.*?)
',
32 | r']+class="tc-sp-pinned-title">(.*)'],
33 | webpage, 'title')
34 |
35 | info = entries[0]
36 | info.update({
37 | 'id': video_id,
38 | 'title': title,
39 | })
40 | return info
41 |
--------------------------------------------------------------------------------
/youtube_dlc/extractor/xbef.py:
--------------------------------------------------------------------------------
1 | from __future__ import unicode_literals
2 |
3 | from .common import InfoExtractor
4 | from ..compat import compat_urllib_parse_unquote
5 |
6 |
7 | class XBefIE(InfoExtractor):
8 | _VALID_URL = r'https?://(?:www\.)?xbef\.com/video/(?P[0-9]+)'
9 | _TEST = {
10 | 'url': 'http://xbef.com/video/5119-glamourous-lesbians-smoking-drinking-and-fucking',
11 | 'md5': 'a478b565baff61634a98f5e5338be995',
12 | 'info_dict': {
13 | 'id': '5119',
14 | 'ext': 'mp4',
15 | 'title': 'md5:7358a9faef8b7b57acda7c04816f170e',
16 | 'age_limit': 18,
17 | 'thumbnail': r're:^http://.*\.jpg',
18 | }
19 | }
20 |
21 | def _real_extract(self, url):
22 | video_id = self._match_id(url)
23 | webpage = self._download_webpage(url, video_id)
24 |
25 | title = self._html_search_regex(
26 | r']*>(.*?)
', webpage, 'title')
27 |
28 | config_url_enc = self._download_webpage(
29 | 'http://xbef.com/Main/GetVideoURLEncoded/%s' % video_id, video_id,
30 | note='Retrieving config URL')
31 | config_url = compat_urllib_parse_unquote(config_url_enc)
32 | config = self._download_xml(
33 | config_url, video_id, note='Retrieving config')
34 |
35 | video_url = config.find('./file').text
36 | thumbnail = config.find('./image').text
37 |
38 | return {
39 | 'id': video_id,
40 | 'url': video_url,
41 | 'title': title,
42 | 'thumbnail': thumbnail,
43 | 'age_limit': 18,
44 | }
45 |
--------------------------------------------------------------------------------
/youtube_dlc/extractor/yourupload.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | from __future__ import unicode_literals
3 |
4 | from .common import InfoExtractor
5 | from ..utils import urljoin
6 |
7 |
8 | class YourUploadIE(InfoExtractor):
9 | _VALID_URL = r'https?://(?:www\.)?(?:yourupload\.com/(?:watch|embed)|embed\.yourupload\.com)/(?P[A-Za-z0-9]+)'
10 | _TESTS = [{
11 | 'url': 'http://yourupload.com/watch/14i14h',
12 | 'md5': '5e2c63385454c557f97c4c4131a393cd',
13 | 'info_dict': {
14 | 'id': '14i14h',
15 | 'ext': 'mp4',
16 | 'title': 'BigBuckBunny_320x180.mp4',
17 | 'thumbnail': r're:^https?://.*\.jpe?g',
18 | }
19 | }, {
20 | 'url': 'http://www.yourupload.com/embed/14i14h',
21 | 'only_matching': True,
22 | }, {
23 | 'url': 'http://embed.yourupload.com/14i14h',
24 | 'only_matching': True,
25 | }]
26 |
27 | def _real_extract(self, url):
28 | video_id = self._match_id(url)
29 |
30 | embed_url = 'http://www.yourupload.com/embed/%s' % video_id
31 |
32 | webpage = self._download_webpage(embed_url, video_id)
33 |
34 | title = self._og_search_title(webpage)
35 | video_url = urljoin(embed_url, self._og_search_video_url(webpage))
36 | thumbnail = self._og_search_thumbnail(webpage, default=None)
37 |
38 | return {
39 | 'id': video_id,
40 | 'title': title,
41 | 'url': video_url,
42 | 'thumbnail': thumbnail,
43 | 'http_headers': {
44 | 'Referer': embed_url,
45 | },
46 | }
47 |
--------------------------------------------------------------------------------
/youtube_dlc/postprocessor/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import unicode_literals
2 |
3 | from .embedthumbnail import EmbedThumbnailPP
4 | from .ffmpeg import (
5 | FFmpegPostProcessor,
6 | FFmpegEmbedSubtitlePP,
7 | FFmpegExtractAudioPP,
8 | FFmpegFixupStretchedPP,
9 | FFmpegFixupM3u8PP,
10 | FFmpegFixupM4aPP,
11 | FFmpegMergerPP,
12 | FFmpegMetadataPP,
13 | FFmpegVideoConvertorPP,
14 | FFmpegVideoRemuxerPP,
15 | FFmpegSubtitlesConvertorPP,
16 | )
17 | from .xattrpp import XAttrMetadataPP
18 | from .execafterdownload import ExecAfterDownloadPP
19 | from .metadatafromtitle import MetadataFromTitlePP
20 |
21 |
22 | def get_postprocessor(key):
23 | return globals()[key + 'PP']
24 |
25 |
26 | __all__ = [
27 | 'EmbedThumbnailPP',
28 | 'ExecAfterDownloadPP',
29 | 'FFmpegEmbedSubtitlePP',
30 | 'FFmpegExtractAudioPP',
31 | 'FFmpegFixupM3u8PP',
32 | 'FFmpegFixupM4aPP',
33 | 'FFmpegFixupStretchedPP',
34 | 'FFmpegMergerPP',
35 | 'FFmpegMetadataPP',
36 | 'FFmpegPostProcessor',
37 | 'FFmpegSubtitlesConvertorPP',
38 | 'FFmpegVideoConvertorPP',
39 | 'FFmpegVideoRemuxerPP',
40 | 'MetadataFromTitlePP',
41 | 'XAttrMetadataPP',
42 | ]
43 |
--------------------------------------------------------------------------------
/youtube_dlc/postprocessor/execafterdownload.py:
--------------------------------------------------------------------------------
1 | from __future__ import unicode_literals
2 |
3 | import subprocess
4 |
5 | from .common import PostProcessor
6 | from ..compat import compat_shlex_quote
7 | from ..utils import (
8 | encodeArgument,
9 | PostProcessingError,
10 | )
11 |
12 |
13 | class ExecAfterDownloadPP(PostProcessor):
14 | def __init__(self, downloader, exec_cmd):
15 | super(ExecAfterDownloadPP, self).__init__(downloader)
16 | self.exec_cmd = exec_cmd
17 |
18 | def run(self, information):
19 | cmd = self.exec_cmd
20 | if '{}' not in cmd:
21 | cmd += ' {}'
22 |
23 | cmd = cmd.replace('{}', compat_shlex_quote(information['filepath']))
24 |
25 | self._downloader.to_screen('[exec] Executing command: %s' % cmd)
26 | retCode = subprocess.call(encodeArgument(cmd), shell=True)
27 | if retCode != 0:
28 | raise PostProcessingError(
29 | 'Command returned error code %d' % retCode)
30 |
31 | return [], information
32 |
--------------------------------------------------------------------------------
/youtube_dlc/version.py:
--------------------------------------------------------------------------------
1 | from __future__ import unicode_literals
2 |
3 | __version__ = '2020.11.11-2'
4 |
--------------------------------------------------------------------------------