before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
if thumbnail_id not in _QUALITIES:
continue
thumbnails.append({
'url': thumbnail_url,
'preference': quality_key(thumbnail_id),
})
return {
'id': info['_id'],
'title': info.get('tit... | > moments seem to be a multipurpose feature (but for now this might be the only type that exists), and I have a feeling that when Twitch modifies this feature, chapter extraction might silently break and I'll never notice.
probably this is silly, but I see it the way as there is a warning too when a description was no... | continue
if thumbnail_id not in _QUALITIES:
continue
thumbnails.append({
'url': thumbnail_url,
'preference': quality_key(thumbnail_id),
})
return {
'id': info['_id'],
... | @@ -306,6 +348,26 @@ def _extract_info(info):
@staticmethod
def _extract_info_gql(info, item_id):
+ def moment_to_chapter(moment):
+ moment = moment.get('node')
+ if moment.get('type') != 'GAME_CHANGE':
+ # TODO: warning or debug log if found unknown moment type
+... | yt_dlp/extractor/twitch.py | 26 | Python | 0.643 | refactor | 522 | 51 | 51 | false | Twitch VOD extractor - chapters | 1,515 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mpeter50 |
'id': info['_id'],
'title': info.get('title') or 'Untitled Broadcast',
'description': info.get('description'),
'duration': int_or_none(info.get('length')),
'thumbnails': thumbnails,
'uploader': info.get('channel', {}).get('display_name'),
... | 1. `chapters` should be `None` (not `[]`) if chapter data extraction fails
2. It is bad practice to clear a nonlocal variable like this, especially in the middle of assigning it | return {
'id': info['_id'],
'title': info.get('title') or 'Untitled Broadcast',
'description': info.get('description'),
'duration': int_or_none(info.get('length')),
'thumbnails': thumbnails,
'uploader': info.get('channel', {}).get('display_... | @@ -306,6 +348,26 @@ def _extract_info(info):
@staticmethod
def _extract_info_gql(info, item_id):
+ def moment_to_chapter(moment):
+ moment = moment.get('node')
+ if moment.get('type') != 'GAME_CHANGE':
+ # TODO: warning or debug log if found unknown moment type
+... | yt_dlp/extractor/twitch.py | 26 | Python | 0.571 | bug | 178 | 51 | 51 | false | Twitch VOD extractor - chapters | 1,515 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mpeter50 |
}
],
},
'params': {
'skip_download': True
}
}]
def _download_info(self, item_id):
data = self._download_gql(
item_id, [{
'operationName': 'VideoMetadata',
'variables': {
'chan... | ```suggestion
video = traverse_obj(data, (0, 'data', 'video'))
``` | 'end_time': 11643,
'title': 'Art'
}
],
},
'params': {
'skip_download': True
}
}]
def _download_info(self, item_id):
data = self._download_gql(
item_id, [{
'operationName':... | @@ -259,9 +292,18 @@ def _download_info(self, item_id):
'channelLogin': '',
'videoID': item_id,
},
+ }, {
+ 'operationName': 'VideoPlayer_ChapterSelectButtonVideo',
+ 'variables': {
+ 'includePrivate':... | yt_dlp/extractor/twitch.py | 26 | Python | 0.571 | suggestion | 76 | 51 | 51 | false | Twitch VOD extractor - chapters | 1,515 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mpeter50 |
'upload_date': '20210924',
'timestamp': 1632448649.0,
'uploader': 'YouLotWhatDontStop',
},
'params': {
'format': 'bestvideo',
'skip_download': True,
},
}, {
'url': 'https://nova.rs/vesti/politika/zaklina-tatalovic-ani-brnabi... | u can't do that
Either make a new extractor, or better just leave it be | 'upload_date': '20210924',
'timestamp': 1632448649.0,
'uploader': 'YouLotWhatDontStop',
},
'params': {
'format': 'bestvideo',
'skip_download': True,
},
}, {
'url': 'https://nova.rs/vesti/politika/zaklina-tatalovic-ani-brnabi... | @@ -93,13 +91,24 @@ class N1InfoIIE(InfoExtractor):
'format': 'bestvideo',
'skip_download': True,
},
+ }, {
+ 'url': 'https://nova.rs/vesti/politika/zaklina-tatalovic-ani-brnabic-pricate-lazi-video/',
+ 'info_dict': {
+ 'id': 'tnjganabrnabicizaklinatatalovi... | yt_dlp/extractor/n1.py | 26 | Python | 0.286 | refactor | 74 | 51 | 51 | false | [N1] Add support for nova.rs | 1,537 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
}, {
'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_coo... | ```suggestion
code = parse_qs(login_handle.geturl()).get('code')
if not code:
raise ExtractorError('Login failed', expected=True)
```
import parse_qs from utils |
def _login(self):
username, password = self._get_login_info()
if username is None or password is None:
self.raise_login_required('Login is required to access any iPrima content', method='password')
login_page = self._download_webpage(
self._LOGIN_URL, None, note='D... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.929 | bug | 193 | 51 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
video_id = self._search_regex(
(r'<iframe[^>]+\bsrc=["\'](?:https?:)?//(?:api\.play-backend\.iprima\.cz/prehravac/embedded|prima\.iprima\.cz/[^/]+/[^/]+)\?.*?\bid=(p\d+)',
r'data-product="([^"]+)">',
r'id=["\']player-(p\d+)"',
r'playerId\s*:\s*["\']player-(p\d... | unnecessary
```suggestion
``` | _, login_handle = self._download_webpage_handle(
self._LOGIN_URL, None, data=urlencode_postdata(login_form),
note='Logging in')
code = parse_qs(login_handle.geturl()).get('code')[0]
if not code:
raise ExtractorError('Login failed', expected=True)
tok... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.429 | suggestion | 31 | 51 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
elif format_key == 'dash' or ext == 'mpd':
return
new_formats = self._extract_mpd_formats(
format_url, video_id, mpd_id='dash', fatal=False)
if lang:
for f in new_formats:
if not f.get('language'):
... | 1. handle is unused
2. Avoid +ing strings
```suggestion
metadata = self._download_json(
f'https://api.play-backend.iprima.cz/api/v1//products/id-{video_id}/play',
video_id, note='Getting manifest URLs', errnote='Failed to get manifest URLs',
headers={'X-OTT-Access-Token... | self.raise_geo_restricted(countries=['CZ'], metadata_available=True)
elif error_code is not None:
self.raise_no_formats('Access to stream infos forbidden', expected=True)
def _real_initialize(self):
if not self.access_token:
self._login()
def _real_extract(s... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 1 | bug | 381 | 41 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
# iframe api.play-backend.iprima.cz
'url': 'https://prima.iprima.cz/my-little-pony/mapa-znameni-2-2',
'only_matching': True,
}, {
# iframe prima.iprima.cz
'url': 'https://prima.iprima.cz/porady/jak-se-stavi-sen/rodina-rathousova-praha',
'only_matching': True,
}, {... | ```suggestion
self.raise_login_required('Login is required to access any iPrima content', method='password')
``` | 'only_matching': True,
}, {
'url': 'https://prima.iprima.cz/porady/jak-se-stavi-sen/rodina-rathousova-praha',
'only_matching': True,
}, {
'url': 'http://www.iprima.cz/filmy/desne-rande',
'only_matching': True,
}, {
'url': 'https://zoom.iprima.cz/10-nejvetsich-... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.714 | suggestion | 126 | 51 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
}, {
# iframe api.play-backend.iprima.cz
'url': 'https://prima.iprima.cz/my-little-pony/mapa-znameni-2-2',
'only_matching': True,
}, {
# iframe prima.iprima.cz
'url': 'https://prima.iprima.cz/porady/jak-se-stavi-sen/rodina-rathousova-praha',
'only_matching': True,... | why is self._LOGIN_REQUIRED needed? | 'url': 'https://prima.iprima.cz/my-little-pony/mapa-znameni-2-2',
'only_matching': True,
}, {
'url': 'https://prima.iprima.cz/porady/jak-se-stavi-sen/rodina-rathousova-praha',
'only_matching': True,
}, {
'url': 'http://www.iprima.cz/filmy/desne-rande',
'only_match... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.071 | question | 35 | 51 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
# coding: utf-8
from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
determine_ext,
js_to_json,
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_GEO_BYPASS = False
_TESTS... | title is too long. Use the md5 | 'id': video_id,
'title': title,
'thumbnail': self._html_search_meta(
['thumbnail', 'og:image', 'twitter:image'],
webpage, 'thumbnail', default=None),
'formats': formats,
'description': self._html_search_meta(
['d... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.143 | refactor | 30 | 150 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
# coding: utf-8
from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
determine_ext,
js_to_json,
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_GEO_BYPASS = False
_TESTS... | ```suggestion
'skip_download': 'm3u8'
``` | ['thumbnail', 'og:image', 'twitter:image'],
webpage, 'thumbnail', default=None),
'formats': formats,
'description': self._html_search_meta(
['description', 'og:description', 'twitter:description'],
webpage, 'description', default=No... | @@ -66,9 +63,130 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.571 | suggestion | 55 | 150 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
# coding: utf-8
from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
determine_ext,
js_to_json,
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_GEO_BYPASS = False
_TESTS... | why remove metadata_available? It allows user to extract the metadata with `--ignore-no-formats-error` even if geo-blocked | f['language'] = lang
formats.extend(new_formats)
options = self._parse_json(
self._search_regex(
r'(?s)(?:TDIPlayerOptions|playerOptions)\s*=\s*({.+?});\s*\]\]',
playerpage, 'player options', default='{}'),
video_id, tr... | @@ -136,7 +254,7 @@ def extract_formats(format_url, format_key=None, lang=None):
extract_formats(src)
if not formats and '>GEO_IP_NOT_ALLOWED<' in playerpage:
- self.raise_geo_restricted(countries=['CZ'], metadata_available=True)
+ self.raise_geo_restricted(countries=['... | yt_dlp/extractor/iprima.py | 26 | Python | 0.714 | refactor | 122 | 150 | 34 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
# coding: utf-8
from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
determine_ext,
js_to_json,
urlencode_postdata,
ExtractorError,
parse_qs
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/... | ```suggestion
access_token = None
``` | # coding: utf-8
from __future__ import unicode_literals
import re
import time
from .common import InfoExtractor
from ..utils import (
determine_ext,
js_to_json,
urlencode_postdata,
ExtractorError,
parse_qs
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/... | @@ -8,12 +8,19 @@
from ..utils import (
determine_ext,
js_to_json,
+ urlencode_postdata,
+ ExtractorError,
+ parse_qs
)
class IPrimaIE(InfoExtractor):
- _VALID_URL = r'https?://(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
+ _VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/(?:[^... | yt_dlp/extractor/iprima.py | 23 | Python | 0.429 | suggestion | 43 | 48 | 48 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
raise ExtractorError('Login failed', expected=True)
token_request_data = {
'scope': 'openid+email+profile+phone+address+offline_access',
'client_id': 'prima_sso',
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': 'https://a... | ```suggestion
if not self.access_token:
self._login()
``` | raise ExtractorError('Login failed', expected=True)
token_request_data = {
'scope': 'openid+email+profile+phone+address+offline_access',
'client_id': 'prima_sso',
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': 'https://a... | @@ -66,9 +63,126 @@ class IPrimaIE(InfoExtractor):
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
- }, {
- 'url': 'https://autosalon.iprima.cz/motorsport/7-epizoda-1',
- 'only_matching': True,
+ }]
+
+ def _login(self):
+ ... | yt_dlp/extractor/iprima.py | 26 | Python | 0.571 | suggestion | 80 | 51 | 51 | false | [iPrima] Fix extractor | 1,541 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | stanoarn |
# coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
try_get,
)
class DroobleIE(InfoExtractor):
_VALID_URL = r'https?://drooble\.com/(?:(?P<user>[^/]+)?/?(?P<kind>song|videos|music/albums)/(?P<id>\d+)... | Seems u never actually ran the test :/ | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
try_get,
)
class DroobleIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://drooble\.com/(?:
(?:(?P<user>[^/]+)/)?(?P<kind>song|videos|music/a... | @@ -0,0 +1,106 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ try_get,
+)
+
+
+class DroobleIE(InfoExtractor):
+ _VALID_URL = r'https?://drooble\.com/(?:(?P<user>[^/]+)?/?(?P<kind>song... | yt_dlp/extractor/drooble.py | 18 | Python | 0.071 | suggestion | 38 | 43 | 43 | false | [Drooble] Add extractor | 1,547 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
# coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
try_get,
)
class DroobleIE(InfoExtractor):
_VALID_URL = r'https?://drooble\.com/(?:(?P<user>[^/]+)?/?(?P<kind>song|videos|music/albums)/(?P<id>\d+)... | it shouldn't be this lol
U need to manually set ext during extraction ig | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
try_get,
)
class DroobleIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://drooble\.com/(?:
(?:(?P<user>[^/]+)/)?(?P<kind>song|videos|music/a... | @@ -0,0 +1,112 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ try_get,
+)
+
+
+class DroobleIE(InfoExtractor):
+ _VALID_URL = r'https?://drooble\.com/(?:(?P<user>[^/]+)?/?(?P<kind>song... | yt_dlp/extractor/drooble.py | 21 | Python | 0.286 | refactor | 73 | 46 | 46 | false | [Drooble] Add extractor | 1,547 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | u-spec-png |
parse_duration,
parse_filesize,
extract_attributes,
int_or_none,
)
class VuploadIE(InfoExtractor):
_VALID_URL = r'https://vupload\.com/v/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://vupload.com/v/u28d0pl2tphy',
'md5': '9b42a4a193cca64d80248e58527d83c8',
'info_dict': {... | try `transform_source=js_to_json` instead of manually replacing | parse_duration,
parse_filesize,
extract_attributes,
int_or_none,
js_to_json
)
class VuploadIE(InfoExtractor):
_VALID_URL = r'https://vupload\.com/v/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://vupload.com/v/u28d0pl2tphy',
'md5': '9b42a4a193cca64d80248e58527d83c8',
... | @@ -28,8 +28,11 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
- video_e = self._html_search_regex(r'\|([a-z0-9]{60})\|', webpage, 'video')
- video_url = f'https://wurize.megaup... | yt_dlp/extractor/vupload.py | 26 | Python | 0.429 | suggestion | 63 | 50 | 51 | false | [Vupload] Fix extractor | 1,549 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'format': 'bestvideo',
},
}, {
'url': 'https://zen.yandex.ru/video/watch/6002240ff8b1af50bb2da5e3',
'info_dict': {
'id': '6002240ff8b1af50bb2da5e3',
'ext': 'mp4',
'title': 'Извержение вулкана из спичек: зрелищный опыт',
'description... | ```suggestion
serverstate = self._search_regex(r'(_+serverState_+video-site_[^_]+_+)',
webpage, 'server state').replace('State', 'Settings')
``` | 'format': 'bestvideo',
},
}, {
'url': 'https://zen.yandex.ru/video/watch/6002240ff8b1af50bb2da5e3',
'info_dict': {
'id': '6002240ff8b1af50bb2da5e3',
'ext': 'mp4',
'title': 'Извержение вулкана из спичек: зрелищный опыт',
'description... | @@ -177,23 +197,36 @@ class ZenYandexIE(InfoExtractor):
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
- data_json = self._parse_json(self._search_regex(r'w\._data\s?=\s?({.+?});', webpage, 'metadata'), id)
- stream_json = try_get(da... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.786 | suggestion | 196 | 51 | 51 | false | [ZenYandex] Fix extractor | 1,558 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
}, {
'url': 'https://zen.yandex.ru/video/watch/6002240ff8b1af50bb2da5e3',
'info_dict': {
'id': '6002240ff8b1af50bb2da5e3',
'ext': 'mp4',
'title': 'Извержение вулкана из спичек: зрелищный опыт',
'description': 'Канал Lavina собрал из сотен спичек внушит... | ```suggestion
uploader = self._search_regex(r'(<a\s*class=["\']card-channel-link[^"\']+["\'][^>]+>)',
webpage, 'uploader', default='<a>')
```
are u using some automated tool to do the line splittig? They often dont make any sense for actual readability | }, {
'url': 'https://zen.yandex.ru/video/watch/6002240ff8b1af50bb2da5e3',
'info_dict': {
'id': '6002240ff8b1af50bb2da5e3',
'ext': 'mp4',
'title': 'Извержение вулкана из спичек: зрелищный опыт',
'description': 'md5:053ad3c61b5596d510c9a199dc8ee633',
... | @@ -177,23 +197,36 @@ class ZenYandexIE(InfoExtractor):
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
- data_json = self._parse_json(self._search_regex(r'w\._data\s?=\s?({.+?});', webpage, 'metadata'), id)
- stream_json = try_get(da... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.786 | suggestion | 302 | 51 | 51 | false | [ZenYandex] Fix extractor | 1,558 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'params': {
'skip_download': 'm3u8',
},
}, {
'url': 'https://zen.yandex.ru/media/id/606fd806cc13cb3c58c05cf5/novyi-samsung-fold-3-moskvich-barahlit-612f93b7f8d48e7e945792a2?from=channel&rid=2286618386.482.1630817595976.42360',
'only_matching': True,
}]
def _real_... | ```suggestion
ext = determine_ext(s_url)
if ext == 'mpd':
formats.extend(self._extract_mpd_formats(s_url, id, mpd_id='dash'))
elif ext == 'm3u8':
formats.extend(self._extract_m3u8_formats(s_url, id, 'mp4'))
```
doesnt this make more sense? | 'params': {
'skip_download': 'm3u8',
},
}, {
'url': 'https://zen.yandex.ru/media/id/606fd806cc13cb3c58c05cf5/novyi-samsung-fold-3-moskvich-barahlit-612f93b7f8d48e7e945792a2?from=channel&rid=2286618386.482.1630817595976.42360',
'only_matching': True,
}]
def _real_... | @@ -177,23 +197,36 @@ class ZenYandexIE(InfoExtractor):
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
- data_json = self._parse_json(self._search_regex(r'w\._data\s?=\s?({.+?});', webpage, 'metadata'), id)
- stream_json = try_get(da... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.857 | refactor | 314 | 51 | 51 | false | [ZenYandex] Fix extractor | 1,558 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'class', 'instagram-media', webpage)
if blockquote_el is None:
return
mobj = re.search(
r'<a[^>]+href=([\'"])(?P<link>[^\'"]+)\1', blockquote_el)
if mobj:
return mobj.group('link')
def _get_id(self, id):
"""Source: https://stackoverfl... | why not just
```suggestion
if url.startswith('instagram://'):
url = f'http://instagram.com/tv/{self._get_id(self._match_id(url))}/'
mobj = self._match_valid_url(url)
``` | 'title': 'Fingerboarding Tricks with @cass.fb',
'thumbnail': r're:^https?://.*\.jpg',
'duration': 53.83,
'timestamp': 1530032919,
'upload_date': '20180626',
'uploader_id': 'instagram',
'uploader': 'Instagram',
'like_count': ... | @@ -190,12 +197,27 @@ def _extract_embed_url(webpage):
if mobj:
return mobj.group('link')
+ def _get_id(self, id):
+ """Source: https://stackoverflow.com/questions/24437823/getting-instagram-post-url-from-media-id"""
+ chrs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz... | yt_dlp/extractor/instagram.py | 26 | Python | 0.786 | suggestion | 202 | 51 | 51 | false | [Instagram] Add IOS URL support | 1,560 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
)
class CanvasIE(InfoExtractor):
_VALID_URL = r'https?://mediazone\.vrt\.be/api/v1/(?P<site_id>canvas|een|ketnet|vrt(?:video|nieuws)|sporza|dako)/assets/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://mediazone.vrt.be/api/v1/ketnet/assets/md-ast-4ac54990-ce66-4d00-a8ca-9eac86f4c475',
'md5': '37b... | this seems to be no longer needed. Can you try changing the code to always go through `m3u8_native` and see if it works? (install pycryptodomex when testing) | )
class CanvasIE(InfoExtractor):
_VALID_URL = r'https?://mediazone\.vrt\.be/api/v1/(?P<site_id>canvas|een|ketnet|vrt(?:video|nieuws)|sporza|dako)/assets/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://mediazone.vrt.be/api/v1/ketnet/assets/md-ast-4ac54990-ce66-4d00-a8ca-9eac86f4c475',
'md5': '37b... | @@ -40,10 +41,9 @@ class CanvasIE(InfoExtractor):
}]
_GEO_BYPASS = False
_HLS_ENTRY_PROTOCOLS_MAP = {
- 'HLS': 'm3u8_native',
'HLS_AES': 'm3u8',
} | yt_dlp/extractor/canvas.py | 26 | Python | 0.5 | suggestion | 157 | 51 | 51 | false | fix vrt downloads | 1,566 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pgaig |
url_or_none,
urlencode_postdata
)
class CanvasIE(InfoExtractor):
_VALID_URL = r'https?://mediazone\.vrt\.be/api/v1/(?P<site_id>canvas|een|ketnet|vrt(?:video|nieuws)|sporza|dako)/assets/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://mediazone.vrt.be/api/v1/ketnet/assets/md-ast-4ac54990-ce66-4d00... | Are you sure HLS always have DRM? Otherwise, it shouldn't be removed like this | url_or_none,
urlencode_postdata
)
class CanvasIE(InfoExtractor):
_VALID_URL = r'https?://mediazone\.vrt\.be/api/v1/(?P<site_id>canvas|een|ketnet|vrt(?:video|nieuws)|sporza|dako)/assets/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://mediazone.vrt.be/api/v1/ketnet/assets/md-ast-4ac54990-ce66-4d00... | @@ -40,10 +41,9 @@ class CanvasIE(InfoExtractor):
}]
_GEO_BYPASS = False
_HLS_ENTRY_PROTOCOLS_MAP = {
- 'HLS': 'm3u8_native', | yt_dlp/extractor/canvas.py | 26 | Python | 0.286 | suggestion | 78 | 51 | 51 | false | fix vrt downloads | 1,566 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pgaig |
self.mark_watched(video_id, player_responses)
return info
class YoutubeTabIE(YoutubeBaseInfoExtractor):
IE_DESC = 'YouTube Tabs'
_VALID_URL = r'''(?x)
https?://
(?:\w+\.)?
(?:
youtube(?:kids)?\.com... | move the list to the base extractor |
self.mark_watched(video_id, player_responses)
return info
class YoutubeTabIE(YoutubeBaseInfoExtractor):
IE_DESC = 'YouTube Tabs'
_VALID_URL = r'''(?x)
https?://
(?:\w+\.)?
(?:
youtube(?:kids)?\.co... | @@ -3063,18 +3063,21 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
(?:\w+\.)?
(?:
youtube(?:kids)?\.com|
- invidio\.us
+ %(invidious)s
)/
... | yt_dlp/extractor/youtube.py | 26 | Python | 0.143 | refactor | 35 | 51 | 51 | false | [youtube] Use the full Invidious site list in playlist, tab extractors | 1,567 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | rhendric |
self.mark_watched(video_id, player_responses)
return info
class YoutubeTabIE(YoutubeBaseInfoExtractor):
IE_DESC = 'YouTube Tabs'
_VALID_URL = r'''(?x)
https?://
(?:\w+\.)?
(?:
youtube(?:kids)?\.co... | `reserved_names` or `reserved` is a better name | info['__post_extractor'] = self.extract_comments(master_ytcfg, video_id, contents, webpage)
self.mark_watched(video_id, player_responses)
return info
class YoutubeTabIE(YoutubeBaseInfoExtractor):
IE_DESC = 'YouTube Tabs'
_VALID_URL = r'''(?x)
https?://
... | @@ -3063,18 +3063,21 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor):
(?:\w+\.)?
(?:
youtube(?:kids)?\.com|
- invidio\.us
+ %(invidious)s
)/
... | yt_dlp/extractor/youtube.py | 26 | Python | 0.286 | suggestion | 47 | 51 | 51 | false | [youtube] Use the full Invidious site list in playlist, tab extractors | 1,567 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | rhendric |
'uploader_id': 'kdla7pillole@iltrovatore.it',
'timestamp': 1443814869,
'upload_date': '20151002',
},
}, {
'url': 'http://www.la7.it/omnibus/rivedila7/omnibus-news-02-07-2016-189077',
'only_matching': True,
}]
def _real_extract(self, url):
... | I dont know if it is really usefull to make a request just for getting the filesize. No other extractor does this | 'thumbnail': 're:^https?://.*',
'upload_date': '20151002',
},
}, {
'url': 'http://www.la7.it/omnibus/rivedila7/omnibus-news-02-07-2016-189077',
'only_matching': True,
}]
_HOST = 'https://awsvodpkg.iltrovatore.it'
def _generate_mp4_url(self, quality, m3u8_... | @@ -25,19 +26,39 @@ class LA7IE(InfoExtractor):
'url': 'http://www.la7.it/crozza/video/inccool8-02-10-2015-163722',
'md5': '8b613ffc0c4bf9b9e377169fc19c214c',
'info_dict': {
- 'id': '0_42j6wd36',
+ 'id': 'inccool8-02-10-2015-163722',
'ext': 'mp4',
... | yt_dlp/extractor/la7.py | 26 | Python | 0.429 | refactor | 113 | 51 | 51 | false | [la7] Improvements to the extractor | 1,575 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
def _real_extract(self, url):
video_id = self._match_id(url)
if not url.startswith('http'):
url = '%s//%s' % (self.http_scheme(), url)
webpage = self._download_webpage(url, video_id)
upload_date = self._search_regex(r'datetime="(.+?)"', webpage, 'upload_date', fatal=F... | ```suggestion
for q in filter(None, video_path.split(',')):
``` |
def _real_extract(self, url):
video_id = self._match_id(url)
if not url.startswith('http'):
url = '%s//%s' % (self.http_scheme(), url)
webpage = self._download_webpage(url, video_id)
video_path = self._search_regex(r'(/content/.*?).mp4', webpage, 'video_path')
... | @@ -47,21 +67,37 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, video_id)
- player_data = self._search_regex(
- [r'(?s)videoParams\s*=\s*({.+?});', r'videoLa7\(({[^;]+})\);'],
- webpage, 'player data')
- vid = self._search_regex(r'vid\s*:\s*"(.+?)... | yt_dlp/extractor/la7.py | 26 | Python | 0.571 | suggestion | 73 | 51 | 51 | false | [la7] Improvements to the extractor | 1,575 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
_BASE_URLS = r'''
(?:
www\.aljazeera\.com|
www\.aljazeera\.net|
chinese\.aljazeera\.net|
... | wouldnt `\w+\.aljazeera\.\w+` be better | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
try_get,
)
class AlJazeeraIE(InfoExtractor):
_VALID_URL = r'https?://(?P<base>\w+\.aljazeera\.\w+)/(?P<type>programs?/[^/]+|(?:feature|video|new)s)?/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#... | @@ -1,55 +1,60 @@
+# coding: utf-8
from __future__ import unicode_literals
-import json
-
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
+ _BASE_URLS ... | yt_dlp/extractor/aljazeera.py | 17 | Python | 0.286 | suggestion | 39 | 42 | 42 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'id': '6280641530001',
'ext': 'mp4',
'title': 'Pojedini domovi u Sarajevu još pod vodom, mještanima se dostavlja hrana',
'timestamp': 1636219149,
'description': 'U sarajevskim naseljima Rajlovac i Reljevo stambeni objekti, ali i industrijska postrojenja i dalj... | using named groups are better here | _VALID_URL = r'https?://(?P<base>\w+\.aljazeera\.\w+)/(?P<type>programs?/[^/]+|(?:feature|video|new)s)?/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
_TESTS = [{
'url': 'https://balkans.aljazeera.net/videos/2021/11/6/pojedini-domovi-u-sarajevu-jos-pod-vodom-mjestanima-se-dostavlja-hrana',
'info_dict'... | @@ -1,55 +1,50 @@
+# coding: utf-8
from __future__ import unicode_literals
-import json
-
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
+ _VALID_URL ... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.143 | suggestion | 34 | 39 | 51 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'ext': 'mp4',
'title': 'Pojedini domovi u Sarajevu još pod vodom, mještanima se dostavlja hrana',
'timestamp': 1636219149,
'description': 'U sarajevskim naseljima Rajlovac i Reljevo stambeni objekti, ali i industrijska postrojenja i dalje su pod vodom.',
'uplo... | are u sure it's `id` and not `video_id`. Also, `all((a, b, c, d))` is the idomatic way to do this (assuming empty strings arent allowed ofc |
_TESTS = [{
'url': 'https://balkans.aljazeera.net/videos/2021/11/6/pojedini-domovi-u-sarajevu-jos-pod-vodom-mjestanima-se-dostavlja-hrana',
'info_dict': {
'id': '6280641530001',
'ext': 'mp4',
'title': 'Pojedini domovi u Sarajevu još pod vodom, mještanima se dosta... | @@ -1,55 +1,50 @@
+# coding: utf-8
from __future__ import unicode_literals
-import json
-
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
+ _VALID_URL ... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.5 | suggestion | 140 | 38 | 51 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'id': '6280654936001',
'ext': 'mp4',
'title': 'Đoković ušao u finale Mastersa u Parizu',
'timestamp': 1636221686,
'description': 'Novak Đoković je u polufinalu Mastersa u Parizu nakon preokreta pobijedio Poljaka Huberta Hurkacza.',
'upload_date': '... | `video_id` is never used? Are you sure this is correct? | 'upload_date': '20211106',
}
}, {
'url': 'https://balkans.aljazeera.net/videos/2021/11/6/djokovic-usao-u-finale-mastersa-u-parizu',
'info_dict': {
'id': '6280654936001',
'ext': 'mp4',
'title': 'Đoković ušao u finale Mastersa u Parizu',
... | @@ -1,55 +1,50 @@
+# coding: utf-8
from __future__ import unicode_literals
-import json
-
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
+ _VALID_URL ... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.429 | question | 55 | 29 | 51 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
_VALID_URL = r'(?x)https?://\w+\.aljazeera\.\w+/(?:programs?/[^/]+|(?:feature|video|new)s)?/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
_TESTS = [{
'url': 'https://balkans.aljazeer... | why'd u remove these fallbacks? | 'info_dict': {
'id': '6280654936001',
'ext': 'mp4',
'title': 'Đoković ušao u finale Mastersa u Parizu',
'timestamp': 1636221686,
'description': 'Novak Đoković je u polufinalu Mastersa u Parizu nakon preokreta pobijedio Poljaka Huberta Hurkacza.',
... | @@ -1,55 +1,50 @@
+# coding: utf-8
from __future__ import unicode_literals
-import json
-
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
+ _VALID_URL ... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.143 | question | 31 | 51 | 51 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'timestamp': 1636219149,
'description': 'U sarajevskim naseljima Rajlovac i Reljevo stambeni objekti, ali i industrijska postrojenja i dalje su pod vodom.',
'upload_date': '20211106',
}
}, {
'url': 'https://balkans.aljazeera.net/videos/2021/11/6/djokovic-usao-u-fi... | any reason u r throwing away the existing API based extraction? | 'url': 'https://balkans.aljazeera.net/videos/2021/11/6/pojedini-domovi-u-sarajevu-jos-pod-vodom-mjestanima-se-dostavlja-hrana',
'info_dict': {
'id': '6280641530001',
'ext': 'mp4',
'title': 'Pojedini domovi u Sarajevu još pod vodom, mještanima se dostavlja hrana',
... | @@ -1,55 +1,50 @@
+# coding: utf-8
from __future__ import unicode_literals
-import json
-
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
+ _VALID_URL ... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.286 | refactor | 63 | 36 | 51 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'chinese.aljazeera.net': 'chinese',
'mubasher.aljazeera.net': 'ajm',
}.get(base) or 'aje'
post_type = {
'features': 'post',
'program': 'episode',
'programs': 'episode',
'videos': 'video',
'news': 'news',
}[post_t... | this is always 'default'? If so, why the var | 'chinese.aljazeera.net': 'chinese',
'mubasher.aljazeera.net': 'ajm',
}.get(base) or 'aje'
post_type = {
'features': 'post',
'program': 'episode',
'programs': 'episode',
'videos': 'video',
'news': 'news',
}[post_t... | @@ -1,55 +1,86 @@
+# coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
+from ..utils import (
+ try_get,
+)
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.071 | suggestion | 44 | 46 | 46 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
def _real_extract(self, url):
base, post_type, id = self._match_valid_url(url).groups()
wp = {
'balkans.aljazeera.net': 'ajb',
'chinese.aljazeera.net': 'chinese',
'mubasher.aljazeera.net': 'ajm',
}.get(base) or 'aje'
post_type = {
'feat... | ```suggestion
video = try_get(video, lambda x: x['data']['article']['video']) or {}
```
otherwise the below .get may fail | def _real_extract(self, url):
base, post_type, id = self._match_valid_url(url).groups()
wp = {
'balkans.aljazeera.net': 'ajb',
'chinese.aljazeera.net': 'chinese',
'mubasher.aljazeera.net': 'ajm',
}.get(base) or 'aje'
post_type = {
'feat... | @@ -1,55 +1,86 @@
+# coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
+from ..utils import (
+ try_get,
+)
class AlJazeeraIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?aljazeera\.com/(?P<type>program/[^/]+|(?:feature|video)s)/\d{4}/\d{1,2}/\d... | yt_dlp/extractor/aljazeera.py | 26 | Python | 0.714 | bug | 132 | 50 | 50 | false | [Aljazeera] Fix extractor | 1,577 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'url': format.get('src'),
'format_id': format.get('label'),
'height': format.get('res'),
} for format in sources]
view_count = parse_count(self._html_search_regex(
r'<p\s*class=["\']views_counter["\']>\s*([\d\.,]+)\s*<span>views?</span></p>',
... | ```suggestion
description = (clean_html(get_element_by_class('p-d-txt', webpage))
or self._html_search_meta(('og:description', 'description', 'twitter:description'), webpage))
```
line too long | formats = [{
'url': format.get('src'),
'format_id': format.get('label'),
'height': format.get('res'),
} for format in sources]
view_count = parse_count(self._html_search_regex(
r'<p\s*class=["\']views_counter["\']>\s*([\d\.,]+)\s*<span>views?</spa... | @@ -90,7 +92,10 @@ def _real_extract(self, url):
r'<a\s*class="place-left"[^>]+>(.+?)</a>',
webpage, 'uploader', fatal=False)
- description = self._html_search_meta('description', webpage)
+ description = clean_html(get_element_by_class('p-d-txt', webpage)) or self._html_search... | yt_dlp/extractor/tokentube.py | 26 | Python | 0.786 | refactor | 228 | 51 | 51 | false | [Tokentube] Fix description | 1,578 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
traverse_obj,
)
class MixchIE(InfoExtractor):
IE_NAME = 'mixch'
# allow omitting last /live in the URL, though it's likely uncommon
_VALID_URL = r'https?://(?:www\.)?mixch\.tv/u/(?P<id>... | ```suggestion
```
doesnt matter as long as it doesnt conflict with any other extractor | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
traverse_obj,
)
class MixchIE(InfoExtractor):
IE_NAME = 'mixch'
_VALID_URL = r'https?://(?:www\.)?mixch\.tv/u/(?P<id>\d+)'
TESTS = [{
'url': 'https://mixch.tv/u/16236849/live',... | @@ -0,0 +1,58 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ traverse_obj,
+)
+
+
+class MixchIE(InfoExtractor):
+ IE_NAME = 'mixch'
+ # allow omitting last /live in the URL, though it's likely uncommon | yt_dlp/extractor/mixch.py | 12 | Python | 0.643 | refactor | 88 | 37 | 37 | false | [mixch] add support for mixch.tv | 1,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
traverse_obj,
)
class MixchIE(InfoExtractor):
IE_NAME = 'mixch'
# allow omitting last /live in the URL, though it's likely uncommon
_VALID_URL = r'https?://(?:www\.)?mixch\.tv/u/(?P<id>... | either add fields or make it `only_matching`. Though idk why this test is even needed | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
traverse_obj,
)
class MixchIE(InfoExtractor):
IE_NAME = 'mixch'
_VALID_URL = r'https?://(?:www\.)?mixch\.tv/u/(?P<id>\d+)'
TESTS = [{
'url': 'https://mixch.tv/u/16236849/live',... | @@ -0,0 +1,58 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ traverse_obj,
+)
+
+
+class MixchIE(InfoExtractor):
+ IE_NAME = 'mixch'
+ # allow omitting last /live in the URL, though it's likely uncommon
+ _VALID_URL = r'https?:/... | yt_dlp/extractor/mixch.py | 17 | Python | 0.357 | suggestion | 85 | 42 | 42 | false | [mixch] add support for mixch.tv | 1,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
def _real_extract(self, url):
video_id = self._match_id(url)
url = 'https://mixch.tv/u/%s/live' % video_id
webpage = self._download_webpage(url, video_id)
initial_js_state = self._parse_json(self._search_regex(
r'(?m)^\s*window\.__INITIAL_JS_STATE__\s*=\s*(\{.+?\});\s*$'... | any particular reason to override the webpage_url? | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
traverse_obj,
)
class MixchIE(InfoExtractor):
IE_NAME = 'mixch'
_VALID_URL = r'https?://(?:www\.)?mixch\.tv/u/(?P<id>\d+)'
TESTS = [{
'url': 'https://mixch.tv/u/16236849/live',... | @@ -0,0 +1,58 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ traverse_obj,
+)
+
+
+class MixchIE(InfoExtractor):
+ IE_NAME = 'mixch'
+ # allow omitting last /live in the URL, though it's likely uncommon
+ _VALID_URL = r'https?:/... | yt_dlp/extractor/mixch.py | 26 | Python | 0.214 | question | 50 | 28 | 56 | false | [mixch] add support for mixch.tv | 1,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'title': 'O przedmiotach szkolnych, które przydają się w życiu',
'description': 'Katarzyna Pakosińska w roli coacherki z bezcennymi radami dla słuchaczy dotyczącymi pracy i życia w wyjątkowym stylu. Rozwiąż swoje codzienne problemy z Radiem ZET!',
'release_timestamp': 1592985480,
... | ```suggestion
def _call_api(self, podcast_id, display_id):
return self._download_json(
f'https://player.radiozet.pl/api/podcasts/getPodcast/(node)/{podcast_id}/(station)/radiozet',
display_id)
def _real_extract(self, url):
display_id = self._match_id(url)
... | 'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
'title': 'O przedmiotach szkolnych, które przydają się w życiu',
'description': 'md5:fa72bed49da334b09e5b2f79851f185c',
'release_timestamp': 1592985480,
'ext': 'mp3',
'thumbnail':... | @@ -0,0 +1,50 @@
+# coding: utf-8
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ strip_or_none,
+)
+
+
+class RadioZetPodcastIE(InfoExtractor):
+ _VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
+ _TEST = {
+ 'url': 'https://player.radiozet.pl/Podcas... | yt_dlp/extractor/radiozet.py | 26 | Python | 1 | refactor | 694 | 36 | 37 | false | [radiozet] Add extractor | 1,593 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
}
}
def _call_api(self, podcast_id, display_id):
return self._download_json(
f'https://player.radiozet.pl/api/podcasts/getPodcast/(node)/{podcast_id}/(station)/radiozet',
display_id)
def _real_extract(self, url):
display_id = self._match_id(url)
webp... | ```suggestion
'creator': strip_or_none(traverse_obj(data, ('presenter', 0, 'title'))),
``` | 'creator': 'Katarzyna Pakosińska',
}
}
def _call_api(self, podcast_id, display_id):
return self._download_json(
f'https://player.radiozet.pl/api/podcasts/getPodcast/(node)/{podcast_id}/(station)/radiozet',
display_id)
def _real_extract(self, url):
... | @@ -0,0 +1,50 @@
+# coding: utf-8
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ strip_or_none,
+)
+
+
+class RadioZetPodcastIE(InfoExtractor):
+ _VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
+ _TEST = {
+ 'url': 'https://player.radiozet.pl/Podcas... | yt_dlp/extractor/radiozet.py | 26 | Python | 0.714 | suggestion | 104 | 28 | 29 | false | [radiozet] Add extractor | 1,593 | yt-dlp/yt-dlp | 132,642 | Python | u-spec-png | ghost |
# coding: utf-8
from .common import InfoExtractor
from ..utils import (
traverse_obj,
strip_or_none,
)
class RadioZetPodcastIE(InfoExtractor):
_VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
_TEST = {
'url': 'https://player.radiozet.pl/Podcasty/Nie-Ma-Za-Co/O-przedmiotac... | description is too long. use md5 | # coding: utf-8
from .common import InfoExtractor
from ..utils import (
traverse_obj,
strip_or_none,
)
class RadioZetPodcastIE(InfoExtractor):
_VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
_TEST = {
'url': 'https://player.radiozet.pl/Podcasty/Nie-Ma-Za-Co/O-przedmiotac... | @@ -0,0 +1,51 @@
+# coding: utf-8
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ strip_or_none,
+)
+
+
+class RadioZetPodcastIE(InfoExtractor):
+ _VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
+ _TEST = {
+ 'url': 'https://player.radiozet.pl/Podcas... | yt_dlp/extractor/radiozet.py | 18 | Python | 0.143 | refactor | 32 | 43 | 43 | false | [radiozet] Add extractor | 1,593 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
'md5': 'e03665c316b4fbc5f6a8f232948bbba3',
'info_dict': {
'id': '42154',
'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
'title': 'O przedmiotach szkolnych, które przydają się w życiu',
'description': 'md5:fa72bed49da334b09e5b2f79851f1... | You are only making 1 request to this url so why make it a separate function?
Also don't do `.get('data')[0]` bcoz it will break when data is not present.
Since this is mandatory, just use `['data'][0]` | 'md5': 'e03665c316b4fbc5f6a8f232948bbba3',
'info_dict': {
'id': '42154',
'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
'title': 'O przedmiotach szkolnych, które przydają się w życiu',
'description': 'md5:fa72bed49da334b09e5b2f79851f1... | @@ -0,0 +1,51 @@
+# coding: utf-8
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ strip_or_none,
+)
+
+
+class RadioZetPodcastIE(InfoExtractor):
+ _VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
+ _TEST = {
+ 'url': 'https://player.radiozet.pl/Podcas... | yt_dlp/extractor/radiozet.py | 26 | Python | 0.643 | suggestion | 205 | 40 | 40 | false | [radiozet] Add extractor | 1,593 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | ghost |
_TEST = {
'url': 'https://player.radiozet.pl/Podcasty/Nie-Ma-Za-Co/O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
'md5': 'e03665c316b4fbc5f6a8f232948bbba3',
'info_dict': {
'id': '42154',
'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
... | ```suggestion
podcast_id = self._html_search_regex(r'<div.*?\sid="player".*?\sdata-id=[\'"]([[^\'"]+)['"]',
``` | _TEST = {
'url': 'https://player.radiozet.pl/Podcasty/Nie-Ma-Za-Co/O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
'md5': 'e03665c316b4fbc5f6a8f232948bbba3',
'info_dict': {
'id': '42154',
'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
... | @@ -0,0 +1,51 @@
+# coding: utf-8
+from .common import InfoExtractor
+from ..utils import (
+ traverse_obj,
+ strip_or_none,
+)
+
+
+class RadioZetPodcastIE(InfoExtractor):
+ _VALID_URL = r'https?://player\.radiozet\.pl\/Podcasty/.*?/(?P<id>.+)'
+ _TEST = {
+ 'url': 'https://player.radiozet.pl/Podcas... | yt_dlp/extractor/radiozet.py | 26 | Python | 0.857 | suggestion | 121 | 42 | 42 | false | [radiozet] Add extractor | 1,593 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
# coding: utf-8
from __future__ import unicode_literals
from itertools import zip_longest
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
ExtractorError,
float_or_none,
get_element_by_class,
int_or_none,
srt_subtitles_timecode,
strip_or... | ```suggestion
class LinkedInBaseIE(InfoExtractor):
``` | # coding: utf-8
from __future__ import unicode_literals
from itertools import zip_longest
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
ExtractorError,
float_or_none,
get_element_by_class,
int_or_none,
srt_subtitles_timecode,
strip_or... | @@ -6,21 +6,56 @@
from .common import InfoExtractor
from ..utils import (
+ clean_html,
+ extract_attributes,
ExtractorError,
float_or_none,
+ get_element_by_class,
int_or_none,
srt_subtitles_timecode,
+ strip_or_none,
+ mimetype2ext,
try_get,
urlencode_postdata,
ur... | yt_dlp/extractor/linkedin.py | 24 | Python | 0.643 | refactor | 56 | 49 | 49 | false | [LinkedIn] Add extractor | 1,597 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
class LinkedInIE(LinkedInBase):
_VALID_URL = r'https?://(?:www\.)?linkedin\.com/posts/.+?(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.linkedin.com/posts/mishalkhawaja_sendinblueviews-toronto-digitalmarketing-ugcPost-6850898786781339649-mM20',
'info_dict': {
'id': '6850898786781339649... | imo it's cleaner to inline everything except sources | class LinkedInIE(LinkedInBaseIE):
_VALID_URL = r'https?://(?:www\.)?linkedin\.com/posts/.+?(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.linkedin.com/posts/mishalkhawaja_sendinblueviews-toronto-digitalmarketing-ugcPost-6850898786781339649-mM20',
'info_dict': {
'id': '68508987867813396... | @@ -52,32 +87,52 @@ def _get_urn_id(self, video_data):
def _get_video_id(self, video_data, course_slug, video_slug):
return self._get_urn_id(video_data) or '%s/%s' % (course_slug, video_slug)
- def _real_initialize(self):
- if self._logged_in:
- return
- email, password = sel... | yt_dlp/extractor/linkedin.py | 26 | Python | 0.214 | suggestion | 52 | 51 | 51 | false | [LinkedIn] Add extractor | 1,597 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'title': 'Mishal K. on LinkedIn: #sendinblueviews #toronto #digitalmarketing',
'description': 'md5:be125430bab1c574f16aeb186a4d5b19',
'creator': 'Mishal K.'
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_we... | ```suggestion
formats = [{
'url': source['src'],
'ext': mimetype2ext(source.get('type')),
'tbr': float_or_none(source.get('data-bitrate'), scale=1000),
} for source in sources]
``` | 'title': 'Mishal K. on LinkedIn: #sendinblueviews #toronto #digitalmarketing',
'description': 'md5:be125430bab1c574f16aeb186a4d5b19',
'creator': 'Mishal K.'
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_we... | @@ -52,32 +87,52 @@ def _get_urn_id(self, video_data):
def _get_video_id(self, video_data, course_slug, video_slug):
return self._get_urn_id(video_data) or '%s/%s' % (course_slug, video_slug)
- def _real_initialize(self):
- if self._logged_in:
- return
- email, password = sel... | yt_dlp/extractor/linkedin.py | 26 | Python | 0.929 | suggestion | 238 | 51 | 51 | false | [LinkedIn] Add extractor | 1,597 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
class LinkedInIE(LinkedInBaseIE):
_VALID_URL = r'https?://(?:www\.)?linkedin\.com/posts/.+?(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.linkedin.com/posts/mishalkhawaja_sendinblueviews-toronto-digitalmarketing-ugcPost-6850898786781339649-mM20',
'info_dict': {
'id': '685089878678133... | ```suggestion
title = self._html_search_regex(r'<title>([^<]+)</title>', webpage, 'title')
description = clean_html(get_element_by_class('share-update-card__update-text', webpage))
like_count = int_or_none(get_element_by_class('social-counts-reactions__social-counts-numRections', webpage))
... |
class LinkedInIE(LinkedInBaseIE):
_VALID_URL = r'https?://(?:www\.)?linkedin\.com/posts/.+?(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.linkedin.com/posts/mishalkhawaja_sendinblueviews-toronto-digitalmarketing-ugcPost-6850898786781339649-mM20',
'info_dict': {
'id': '685089878678133... | @@ -52,32 +87,47 @@ def _get_urn_id(self, video_data):
def _get_video_id(self, video_data, course_slug, video_slug):
return self._get_urn_id(video_data) or '%s/%s' % (course_slug, video_slug)
- def _real_initialize(self):
- if self._logged_in:
- return
- email, password = sel... | yt_dlp/extractor/linkedin.py | 26 | Python | 0.857 | refactor | 592 | 51 | 51 | false | [LinkedIn] Add extractor | 1,597 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
parse_codecs,
)
class StreamCZIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:stream|televizeseznam)\.cz/.+/(?P<display_id>.+)-(?P<id>[0-9]+)'
_GRAPHQL_URL = 'https://www.televizeseznam.cz/api/graphql'
_GRAPHQL_QUERY = '''query LoadEpisode($urlName : String){ episode(urlName: $urlName){ ...Vi... | md5 this, do same for the description below | urljoin,
)
class StreamCZIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:stream|televizeseznam)\.cz/[^?#]+/(?P<display_id>[^?#]+)-(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.televizeseznam.cz/video/lajna/buh-57953890',
'md5': '40c41ade1464a390a0b447e333df4239',
'info_di... | @@ -1,105 +1,125 @@
# coding: utf-8
from __future__ import unicode_literals
-import hashlib
-import time
+import json
+import re
from .common import InfoExtractor
from ..utils import (
- int_or_none,
- sanitized_Request,
+ urljoin,
+ parse_codecs,
)
-def _get_api_key(api_path):
- if api_path... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.071 | suggestion | 43 | 51 | 51 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | arkamar |
'ext': 'mp4',
}
}, {
'url': 'https://www.stream.cz/tajemno/znicehonic-jim-skrz-strechu-prolitnul-zahadny-predmet-badatele-vse-objasnili-64147267',
'md5': '3ee4d0be040e8f4a543e67e509d55e3f',
'info_dict': {
'id': '64147267',
'display_id': 'znicehonic... | i don't like this tbh. Maybe check for it above append only if it exists | }]
def _extract_formats(self, spl_url, video):
for ext, pref, streams in (
('ts', -1, traverse_obj(video, ('http_stream', 'qualities'))),
('mp4', 1, video.get('mp4'))):
for format_id, stream in streams.items():
if not stream.get('url'):
... | @@ -1,105 +1,125 @@
# coding: utf-8
from __future__ import unicode_literals
-import hashlib
-import time
+import json
+import re
from .common import InfoExtractor
from ..utils import (
- int_or_none,
- sanitized_Request,
+ urljoin,
+ parse_codecs,
)
-def _get_api_key(api_path):
- if api_path... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.214 | suggestion | 72 | 51 | 51 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | arkamar |
'description': "18. listopadu 2010 spadl na jeden z domů v Ohrazenicích na Třebíčsku kus ledu. Badatelé si potom marně lámali hlavu nad tím, kde se mohl vzít. Kus ledu napáchal v domě nemalou škodu, naštěstí jen materiální, nikoho neporanil.\r\n",
'ext': 'mp4',
}
}]
def extract_... | if this doesn't exist then just continue | yield {
'format_id': f'{format_id}-{ext}',
'ext': ext,
'source_preference': pref,
'url': urljoin(spl_url, stream['url']),
'tbr': float_or_none(stream.get('bandwidth'), scale=1000),
'du... | @@ -1,105 +1,125 @@
# coding: utf-8
from __future__ import unicode_literals
-import hashlib
-import time
+import json
+import re
from .common import InfoExtractor
from ..utils import (
- int_or_none,
- sanitized_Request,
+ urljoin,
+ parse_codecs,
)
-def _get_api_key(api_path):
- if api_path... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.071 | suggestion | 41 | 51 | 51 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | arkamar |
if not play_list:
return None
subtitles = {}
for k, v in play_list.items():
if v.get('language'):
for ext in v.get('urls'):
subtitles.setdefault(v['language'], []).append({
'ext': ext,
'u... | Don't think u have to do this with the new commits.
Just set the duration | 'width': traverse_obj(stream, ('resolution', 0)),
'height': traverse_obj(stream, ('resolution', 1)) or int_or_none(format_id.replace('p', '')),
**parse_codecs(stream.get('codec')),
}
def _real_extract(self, url):
display_id, video_... | @@ -1,105 +1,125 @@
# coding: utf-8
from __future__ import unicode_literals
-import hashlib
-import time
+import json
+import re
from .common import InfoExtractor
from ..utils import (
- int_or_none,
- sanitized_Request,
+ urljoin,
+ parse_codecs,
)
-def _get_api_key(api_path):
- if api_path... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.214 | suggestion | 74 | 51 | 51 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | arkamar |
if v.get('bandwidth'):
format.update({'tbr': v['bandwidth'] / 1000})
if v.get('duration'):
format.update({'filesize_approx': v['bandwidth'] * v['duration'] / 8000})
if v.get('codec'):
format.update(parse_codecs(v['codec']))
... | ```suggestion
display_id, video_id = self._match_valid_url(url).groups()
``` | }'''
}).encode('utf-8'),
headers={'Content-Type': 'application/json;charset=UTF-8'}
)['data']['episode']
spl_url = data['spl'] + 'spl2,3'
metadata = self._download_json(spl_url, video_id, 'Downloading playlist')
if 'Location' in metadata and '... | @@ -1,105 +1,125 @@
# coding: utf-8
from __future__ import unicode_literals
-import hashlib
-import time
+import json
+import re
from .common import InfoExtractor
from ..utils import (
- int_or_none,
- sanitized_Request,
+ urljoin,
+ parse_codecs,
)
-def _get_api_key(api_path):
- if api_path... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.571 | suggestion | 86 | 51 | 36 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | arkamar |
spl_url = data['spl'] + 'spl2,3'
metadata = self._download_json(spl_url, video_id, 'Downloading playlist')
if 'Location' in metadata and 'data' not in metadata:
spl_url = metadata['Location']
metadata = self._download_json(spl_url, video_id, 'Downloading redirected playli... | are the rest of these metadata no longer extractable? |
spl_url = data['spl'] + 'spl2,3'
metadata = self._download_json(spl_url, video_id, 'Downloading playlist')
if 'Location' in metadata and 'data' not in metadata:
spl_url = metadata['Location']
metadata = self._download_json(spl_url, video_id, 'Downloading redirected playl... | @@ -1,105 +1,105 @@
# coding: utf-8
-from __future__ import unicode_literals
-
-import hashlib
-import time
+import json
from .common import InfoExtractor
from ..utils import (
+ float_or_none,
int_or_none,
- sanitized_Request,
+ parse_codecs,
+ traverse_obj,
+ urljoin,
)
-def _get_api_key... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.286 | refactor | 53 | 29 | 32 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | arkamar |
data = self._download_json(
'https://www.televizeseznam.cz/api/graphql', video_id, 'Downloading GraphQL result',
data=json.dumps({
'variables': {'urlName': video_id},
'query': '''
query LoadEpisode($urlName : String){ episode(urlName: $... | This is not correct, `video` does not have to contain `subtitles` in which case exception is thrown. I'll fix it. | data = self._download_json(
'https://www.televizeseznam.cz/api/graphql', video_id, 'Downloading GraphQL result',
data=json.dumps({
'variables': {'urlName': video_id},
'query': '''
query LoadEpisode($urlName : String){ episode(urlName: $... | @@ -1,105 +1,104 @@
# coding: utf-8
-from __future__ import unicode_literals
-
-import hashlib
-import time
+import json
from .common import InfoExtractor
from ..utils import (
+ float_or_none,
int_or_none,
- sanitized_Request,
+ parse_codecs,
+ traverse_obj,
+ urljoin,
)
-def _get_api_key... | yt_dlp/extractor/streamcz.py | 26 | Python | 0.643 | suggestion | 113 | 46 | 50 | false | [streamcz] fix extractor | 1,616 | yt-dlp/yt-dlp | 132,642 | Python | arkamar | arkamar |
lambda x: x['authorThumbnail']['thumbnails'][-1]['url'], compat_str)
author_is_uploader = try_get(comment_renderer, lambda x: x['authorIsChannelOwner'], bool)
is_favorited = 'creatorHeart' in (try_get(
comment_renderer, lambda x: x['actionButtons']['commen... | Anyone know of a better way of going about this? Before we were using a list and it wasn't easily readable. The recursive design of the comment extractor makes keeping track of this data a bit messy. | if not comment_id:
return
text = self._get_text(comment_renderer, 'contentText')
# note: timestamp is an estimate calculated from the current time and time_text
time_text = self._get_text(comment_renderer, 'publishedTimeText') or ''
time_text_dt = self.parse_time_te... | @@ -2091,8 +2092,17 @@ def _extract_comment(self, comment_renderer, parent=None):
'parent': parent or 'root'
}
- def _comment_entries(self, root_continuation_data, ytcfg, video_id, parent=None, comment_counts=None):
+ @dataclasses.dataclass
+ class _CommentTracker:
+ running_tota... | yt_dlp/extractor/youtube.py | 26 | Python | 0.429 | refactor | 199 | 51 | 51 | false | [youtube:comments] Add more options for limiting comments extracted and misc cleanup | 1,626 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
'author_id': author_id,
'author_thumbnail': author_thumbnail,
'author_is_uploader': author_is_uploader,
'parent': parent or 'root'
}
@dataclasses.dataclass
class _CommentTracker:
running_total: int = 0
est_total: int = 0
current_pa... | this was being repeated a lot. is there any better way? |
votes = parse_count(try_get(comment_renderer, (lambda x: x['voteCount']['simpleText'],
lambda x: x['likeCount']), compat_str)) or 0
author_thumbnail = try_get(comment_renderer,
lambda x: x['authorThumbnail']['thum... | @@ -2091,8 +2092,17 @@ def _extract_comment(self, comment_renderer, parent=None):
'parent': parent or 'root'
}
- def _comment_entries(self, root_continuation_data, ytcfg, video_id, parent=None, comment_counts=None):
+ @dataclasses.dataclass
+ class _CommentTracker:
+ running_tota... | yt_dlp/extractor/youtube.py | 26 | Python | 0.286 | question | 55 | 51 | 51 | false | [youtube:comments] Add more options for limiting comments extracted and misc cleanup | 1,626 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
compat_str) or visitor_data
continuation_contents = dict_get(response, ('onResponseReceivedEndpoints', 'continuationContents'))
continuation = None
if isinstance(continuation_contents, list):
for continuation_section in continuation_contents:
... | this could possibly go in the `_get_comments` function | if is_first_continuation:
note_prefix = 'Downloading comment section API JSON'
else:
note_prefix = ' Downloading comment API JSON reply thread %d %s' % (
tracker['current_page_thread'], comment_prog_str)
else:... | @@ -2220,7 +2228,11 @@ def extract_thread(contents):
break
continue
count = 0
+ max_parent_comments = int_or_none(get_single_config_arg('max_parent_comments')) or float('inf')
+ max_reply_comments = int_or_n... | yt_dlp/extractor/youtube.py | 26 | Python | 0.429 | suggestion | 54 | 51 | 51 | false | [youtube:comments] Add more options for limiting comments extracted and misc cleanup | 1,626 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
yield comment
# Attempt to get the replies
comment_replies_renderer = try_get(
comment_thread_renderer, lambda x: x['replies']['commentRepliesRenderer'], dict)
if comment_replies_renderer:
comment_tracker[2] += 1
... | using a namedtuple/dict would make this self-documenting | # Attempt to get the replies
comment_replies_renderer = try_get(
comment_thread_renderer, lambda x: x['replies']['commentRepliesRenderer'], dict)
if comment_replies_renderer:
tracker['current_page_thread'] += 1
... | @@ -2134,76 +2133,84 @@ def extract_header(contents):
if not _continuation:
continue
- sort_text = sort_menu_item.get('title')
- if isinstance(sort_text, compat_str):
- sort_text = sort_text.lower()
- else:
+ ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.214 | suggestion | 56 | 51 | 51 | false | [youtube:comments] Add more options for limiting comments extracted and misc cleanup | 1,626 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
if page_num == 0:
if is_first_continuation:
note_prefix = 'Downloading comment section API JSON'
else:
note_prefix = ' Downloading comment API JSON reply thread %d %s' % (
comment_tracker[2], comment_prog_str)... | pretty sure this is same as:
```suggestion
continuation_items = get_first(
continuation_section,
('reloadContinuationItemsCommand', 'appendContinuationItemsAction'), 'continuationItems',
expected_type=list) or []
``` | comment_prog_str = f"({tracker['running_total']}/{tracker['est_total']})"
if page_num == 0:
if is_first_continuation:
note_prefix = 'Downloading comment section API JSON'
else:
note_prefix = ' Downloading comment API JSON... | @@ -2212,83 +2219,33 @@ def extract_thread(contents):
response = self._extract_response(
item_id=None, query=continuation,
ep='next', ytcfg=ytcfg, headers=headers, note=note_prefix,
- check_get_keys=('onResponseReceivedEndpoints', 'continuationContents'))
- ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.929 | suggestion | 298 | 51 | 51 | false | [youtube:comments] Add more options for limiting comments extracted and misc cleanup | 1,626 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
# Attempt to get the replies
comment_replies_renderer = try_get(
comment_thread_renderer, lambda x: x['replies']['commentRepliesRenderer'], dict)
if comment_replies_renderer:
tracker['current_page_thread'] += 1
... | Merge with master. Then you can do:
```py
max_depth = int_or_none(get_single_config_arg('max_comment_depth'))
if max_depth:
self._downloader.deprecation_warning('[youtube] ...')
``` | yield comment
# Attempt to get the replies
comment_replies_renderer = try_get(
comment_thread_renderer, lambda x: x['replies']['commentRepliesRenderer'], dict)
if comment_replies_renderer:
tracker['current_page_thr... | @@ -2187,11 +2180,15 @@ def extract_thread(contents):
total_parent_comments=0,
total_reply_comments=0)
+ # TODO: Deprecated
# YouTube comments have a max depth of 2
max_depth = int_or_none(get_single_config_arg('max_comment_depth')) or 2
if max_depth... | yt_dlp/extractor/youtube.py | 26 | Python | 0.786 | suggestion | 214 | 51 | 51 | false | [youtube:comments] Add more options for limiting comments extracted and misc cleanup | 1,626 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
from __future__ import unicode_literals
from .common import InfoExtractor
class RTRFMIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
_PLAY_SHOW = r"\.playShow\('(?P<show>[^']+)', *'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})', *'(?P<title>[^']+)'\)"
... | can be combined into `playShow(?:From)?` since the 2 regex are otherwise same. Also, move this directly to L57 | from __future__ import unicode_literals
from .common import InfoExtractor
class RTRFMIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
_TESTS = [
{
'url': 'https://rtrfm.com.au/shows/breakfast/',
'md5': '46168394d3a5c... | @@ -0,0 +1,68 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTRFMIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
+ _PLAY_SHOW = r"\.playShow\('(?P<show>[^']+)', *'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})', *'... | yt_dlp/extractor/rtrfm.py | 9 | Python | 0.571 | refactor | 110 | 34 | 34 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
},
{
'url': 'https://rtrfm.com.au/show-episode/breakfast-2020-06-01/',
'md5': '594027f513ec36a24b15d65007a24dff',
'info_dict': {
'id': 'breakfast-2020-06-01',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
... | ```suggestion
'https://restreams.rtrfm.com.au/rzz',
show, 'Downloading MP3 URL', query={'n': show, 'd': date})['u']
``` | 'info_dict': {
'id': 'breakfast-2020-06-01',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
'title': 'Breakfast with Taylah 2020-06-01',
'description': r're:^Breakfast with Taylah ',
},
'skip': 'This au... | @@ -0,0 +1,68 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTRFMIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
+ _PLAY_SHOW = r"\.playShow\('(?P<show>[^']+)', *'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})', *'... | yt_dlp/extractor/rtrfm.py | 26 | Python | 0.714 | suggestion | 146 | 35 | 34 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
'instead of the id, but the id depends on the date.',
},
{
'url': 'https://rtrfm.com.au/show-episode/breakfast-2021-11-11/',
'md5': '396bedf1e40f96c62b30d4999202a790',
'info_dict': {
'id': 'breakfast-2021-11-11',
'ex... | ```suggestion
'skip_download': 'This audio has expired',
``` | 'md5': '396bedf1e40f96c62b30d4999202a790',
'info_dict': {
'id': 'breakfast-2021-11-11',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
'title': 'Breakfast with Taylah 2021-11-11',
'description': 'md5:0979c3ab1febfb... | @@ -0,0 +1,68 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTRFMIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
+ _PLAY_SHOW = r"\.playShow\('(?P<show>[^']+)', *'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})', *'... | yt_dlp/extractor/rtrfm.py | 26 | Python | 0.571 | suggestion | 78 | 47 | 46 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
from __future__ import unicode_literals
from .common import InfoExtractor
class RTRFMIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
_PLAY_SHOW = r"\.playShow\('(?P<show>[^']+)', *'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})', *'(?P<title>[^']+)'\)"
... | Dont use `re:` in id. Just add a test that is passes atm, and then just add something like `'skip': 'ID keeps changing'` | from __future__ import unicode_literals
from .common import InfoExtractor
class RTRFMIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
_TESTS = [
{
'url': 'https://rtrfm.com.au/shows/breakfast/',
'md5': '46168394d3a5c... | @@ -0,0 +1,68 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTRFMIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
+ _PLAY_SHOW = r"\.playShow\('(?P<show>[^']+)', *'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})', *'... | yt_dlp/extractor/rtrfm.py | 24 | Python | 0.571 | suggestion | 120 | 49 | 49 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
'info_dict': {
'id': 'breakfast-2021-11-16',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
'title': r're:^Breakfast with Taylah \d{4}-\d{2}-\d{2}$',
'description': 'md5:0979c3ab1febfbec3f1ccb743633c611',
},
... | ```suggestion
'ext': 'mp4',
```
test was failing | 'info_dict': {
'id': 'breakfast-2021-11-16',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
'title': r're:^Breakfast with Taylah \d{4}-\d{2}-\d{2}$',
'description': 'md5:0979c3ab1febfbec3f1ccb743633c611',
},
... | @@ -0,0 +1,64 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTRFMIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
+ _TESTS = [
+ {
+ 'url': 'https://rtrfm.com.au/shows/breakfast/',
+ ... | yt_dlp/extractor/rtrfm.py | 26 | Python | 0.571 | bug | 67 | 51 | 51 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | pabs3 |
'series': 'Breakfast with Taylah',
'title': 'Breakfast with Taylah 2021-11-11',
'description': 'md5:0979c3ab1febfbec3f1ccb743633c611',
},
},
{
'url': 'https://rtrfm.com.au/show-episode/breakfast-2020-06-01/',
'md5': '594... | this will be a bit more robust
```suggestion
r"\.playShow(?:From)?\(\s*'(?P<show>[^']+)',\s*'(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})',\s*'(?P<title>[^']+)'",
```
even better if you can also handle double quotes | 'series': 'Breakfast with Taylah',
'title': 'Breakfast with Taylah 2021-11-11',
'description': 'md5:0979c3ab1febfbec3f1ccb743633c611',
},
},
{
'url': 'https://rtrfm.com.au/show-episode/breakfast-2020-06-01/',
'md5': '594... | @@ -54,10 +49,11 @@ def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
show, date, title = self._search_regex(
- [self._PLAY_SHOW, self._PLAY_SHOW_FROM],
+ r"\.playShow(?:From)?\('(?P<show>[^']+)', *'(?P<date>... | yt_dlp/extractor/rtrfm.py | 26 | Python | 1 | suggestion | 223 | 39 | 42 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
'url': 'https://rtrfm.com.au/show-episode/breakfast-2020-06-01/',
'md5': '594027f513ec36a24b15d65007a24dff',
'info_dict': {
'id': 'breakfast-2020-06-01',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
'title': 'Breakfa... | ```suggestion
url = None
self.raise_no_formats('Expired or no show on this date', expected=True)
```
This allows user to extract metadata even if expired | 'md5': '594027f513ec36a24b15d65007a24dff',
'info_dict': {
'id': 'breakfast-2020-06-01',
'ext': 'mp3',
'series': 'Breakfast with Taylah',
'title': 'Breakfast with Taylah 2020-06-01',
'description': r're:^Breakfast wit... | @@ -0,0 +1,67 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class RTRFMIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
+ _TESTS = [
+ {
+ 'url': 'https://rt... | yt_dlp/extractor/rtrfm.py | 26 | Python | 0.786 | refactor | 181 | 35 | 35 | false | [rtrfm] Add extractor | 1,628 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
# coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import mimetype2ext, parse_duration, parse_qs, str_or_none, traverse_obj
from .common import InfoExtractor
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger\.com/video\.g\?token=(?P... | ```suggestion
from ..utils import (
mimetype2ext,
parse_duration,
parse_qs,
str_or_none,
traverse_obj,
)
``` | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
mimetype2ext,
parse_duration,
parse_qs,
str_or_none,
traverse_obj,
)
from .common import InfoExtractor
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger... | @@ -0,0 +1,49 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from ..utils import mimetype2ext, parse_duration, parse_qs, str_or_none, traverse_obj | yt_dlp/extractor/blogger.py | 6 | Python | 0.857 | suggestion | 136 | 31 | 31 | false | [blogger] Add support for videos and embeds | 1,629 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger\.com/video\.g\?token=(?P<id>.+)'
_VALID_EMBED = r'''<iframe[^>]+src=["']((?:https?:)?//(?:www\.)?blogger\.com/video\.g\?token=[^"']+)["']'''
_TESTS = [{
'url': 'https://www.blogger.com/video.g?toke... | ```suggestion
data_json = self._search_regex(r'var\s+VIDEO_CONFIG\s*=\s*(\{.*)', webpage, 'JSON data')
data = self._parse_json(data_json.encode('utf-8').decode('unicode_escape'), token_id)
``` | parse_qs,
str_or_none,
traverse_obj,
)
from .common import InfoExtractor
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger\.com/video\.g\?token=(?P<id>.+)'
_VALID_EMBED = r'''<iframe[^>]+src=["']((?:https?:)?//(?:www\.)?blogger\.com/video\.g\?tok... | @@ -0,0 +1,49 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from ..utils import mimetype2ext, parse_duration, parse_qs, str_or_none, traverse_obj
+from .common import InfoExtractor
+
+
+class BloggerIE(InfoExtractor):
+ IE_NAME = 'blogger.com'
+ _VALID_URL = r'https?://(?:www\.)?blo... | yt_dlp/extractor/blogger.py | 26 | Python | 0.786 | security | 211 | 42 | 47 | false | [blogger] Add support for videos and embeds | 1,629 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
'url': 'https://www.blogger.com/video.g?token=AD6v5dzEe9hfcARr5Hlq1WTkYy6t-fXH3BBahVhGvVHe5szdEUBEloSEDSTA8-b111089KbfWuBvTN7fnbxMtymsHhXAXwVvyzHH4Qch2cfLQdGxKQrrEuFpC1amSl_9GuLWODjPgw',
'md5': 'f1bc19b6ea1b0fd1d81e84ca9ec467ac',
'info_dict': {
'id': 'BLOGGER-video-3c740e3a49197e16-7... | `duration` is not a permitted field for individual formats atm. Does different formats have different duration? |
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger\.com/video\.g\?token=(?P<id>.+)'
_VALID_EMBED = r'''<iframe[^>]+src=["']((?:https?:)?//(?:www\.)?blogger\.com/video\.g\?token=[^"']+)["']'''
_TESTS = [{
'url': 'https://www.blogger.com/video.g?toke... | @@ -0,0 +1,49 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from ..utils import mimetype2ext, parse_duration, parse_qs, str_or_none, traverse_obj
+from .common import InfoExtractor
+
+
+class BloggerIE(InfoExtractor):
+ IE_NAME = 'blogger.com'
+ _VALID_URL = r'https?://(?:www\.)?blo... | yt_dlp/extractor/blogger.py | 26 | Python | 0.5 | question | 111 | 36 | 41 | false | [blogger] Add support for videos and embeds | 1,629 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
from __future__ import unicode_literals
import re
from ..utils import (
mimetype2ext,
parse_duration,
parse_qs,
str_or_none,
traverse_obj,
)
from .common import InfoExtractor
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger\.com/video\.g\?... | add `duration` to the test too | from __future__ import unicode_literals
import re
from ..utils import (
mimetype2ext,
parse_duration,
parse_qs,
str_or_none,
traverse_obj,
)
from .common import InfoExtractor
class BloggerIE(InfoExtractor):
IE_NAME = 'blogger.com'
_VALID_URL = r'https?://(?:www\.)?blogger\.com/video\.g\?... | @@ -0,0 +1,54 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from ..utils import (
+ mimetype2ext,
+ parse_duration,
+ parse_qs,
+ str_or_none,
+ traverse_obj,
+)
+from .common import InfoExtractor
+
+
+class BloggerIE(InfoExtractor):
+ IE_NAME = 'blogger.com'
+ _VALID... | yt_dlp/extractor/blogger.py | 26 | Python | 0.214 | suggestion | 30 | 51 | 51 | false | [blogger] Add support for videos and embeds | 1,629 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pabs3 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
)
class RedGifsIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^-/?#\.]+)'
_TESTS = [{
... | ```suggestion
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
)
``` | # coding: utf-8
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
try_get,
)
class RedGifsIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^-/?#\.]+)'
_FORMATS = {
'gif': 250,
'sd': ... | @@ -0,0 +1,113 @@
+# coding: utf-8
+
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ qualities,
+)
+ | yt_dlp/extractor/redgifs.py | 12 | Python | 0.929 | refactor | 138 | 37 | 37 | false | [redgifs] Add extractor | 1,631 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chio0hai |
}
}, {
'url': 'https://thumbs2.redgifs.com/SqueakyHelplessWisent-mobile.mp4#t=0',
'info_dict': {
'id': 'squeakyhelplesswisent',
'ext': 'mp4',
'title': 'Hotwife Legs Thick',
'timestamp': 1636287915,
'upload_date': '20211107',
... | Dont use +
```suggestion
raise ExtractorError(f'RedGifs said: {video_info["error"]}, expected=True)
```
or
```py
raise ExtractorError('RedGifs said: %s' % video_info['error'], expected=True)
``` | 'like_count': int,
'categories': list,
'age_limit': 18,
}
}, {
'url': 'https://thumbs2.redgifs.com/SqueakyHelplessWisent-mobile.mp4#t=0',
'info_dict': {
'id': 'squeakyhelplesswisent',
'ext': 'mp4',
'title': 'Hotwife Legs... | @@ -0,0 +1,113 @@
+# coding: utf-8
+
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ qualities,
+)
+
+
+class RedGifsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^... | yt_dlp/extractor/redgifs.py | 26 | Python | 1 | refactor | 227 | 51 | 51 | false | [redgifs] Add extractor | 1,631 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chio0hai |
'title': 'Hotwife Legs Thick',
'timestamp': 1636287915,
'upload_date': '20211107',
'uploader': 'ignored52',
'duration': 16,
'view_count': int,
'like_count': int,
'categories': list,
'age_limit': 18,
}
... | ```suggestion
title = ' '.join(gif.get('tags') or []) or 'RedGifs'
``` | 'info_dict': {
'id': 'squeakyhelplesswisent',
'ext': 'mp4',
'title': 'Hotwife Legs Thick',
'timestamp': 1636287915,
'upload_date': '20211107',
'uploader': 'ignored52',
'duration': 16,
'view_count': int,
'... | @@ -0,0 +1,113 @@
+# coding: utf-8
+
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ qualities,
+)
+
+
+class RedGifsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^... | yt_dlp/extractor/redgifs.py | 26 | Python | 0.571 | suggestion | 80 | 51 | 51 | false | [redgifs] Add extractor | 1,631 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chio0hai |
def _real_extract(self, url):
video_id = self._match_id(url).lower()
video_info = self._download_json(
'https://api.redgifs.com/v2/gifs/%s' % video_id,
video_id, 'Downloading video info')
if 'error' in video_info:
raise ExtractorError('RedGifs said: ' + v... | put all vars that are actually never used directly in the return statement | }
}]
def _real_extract(self, url):
video_id = self._match_id(url).lower()
video_info = self._download_json(
'https://api.redgifs.com/v2/gifs/%s' % video_id,
video_id, 'Downloading video info')
if 'error' in video_info:
raise ExtractorError(f'... | @@ -0,0 +1,113 @@
+# coding: utf-8
+
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ qualities,
+)
+
+
+class RedGifsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^... | yt_dlp/extractor/redgifs.py | 26 | Python | 0.286 | suggestion | 74 | 51 | 48 | false | [redgifs] Add extractor | 1,631 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chio0hai |
video_info = self._download_json(
'https://api.redgifs.com/v2/gifs/%s' % video_id,
video_id, 'Downloading video info')
if 'error' in video_info:
raise ExtractorError('RedGifs said: ' + video_info['error'], expected=True)
gif = video_info['gif']
urls ... | makes sense as a class var - like this:
```
_FORMATS = {
'gif': 250,
'sd': 480,
'hd': None,
} |
def _real_extract(self, url):
video_id = self._match_id(url).lower()
video_info = self._download_json(
'https://api.redgifs.com/v2/gifs/%s' % video_id,
video_id, 'Downloading video info')
if 'error' in video_info:
raise ExtractorError(f'RedGifs said: {vi... | @@ -0,0 +1,113 @@
+# coding: utf-8
+
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ qualities,
+)
+
+
+class RedGifsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^... | yt_dlp/extractor/redgifs.py | 26 | Python | 0.714 | style | 113 | 51 | 46 | false | [redgifs] Add extractor | 1,631 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chio0hai |
FORMATS = ('gif', 'sd', 'hd')
quality = qualities(FORMATS)
formats = []
for format_id in FORMATS:
video_url = urls.get(format_id)
if not video_url:
continue
if format_id == 'gif':
max_height = 250
elif forma... | ```suggestion
aspect_ratio = try_get(gif, lambda x: orig_height/x['width'])
formats = []
for format_id, height in self._FORMATS.items():
video_url = urls.get(format_id)
if not video_url:
continue
height = min(orig_height, height or orig_... | # coding: utf-8
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
try_get,
)
class RedGifsIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^-/?#\.]+)'
_FORMATS = {
'gif': 250,
'sd': ... | @@ -0,0 +1,113 @@
+# coding: utf-8
+
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ qualities,
+)
+
+
+class RedGifsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:(?:www|thumbs2?)\.)?redgifs\.com/(?:watch/)?(?P<id>[^... | yt_dlp/extractor/redgifs.py | 26 | Python | 0.786 | suggestion | 612 | 40 | 95 | false | [redgifs] Add extractor | 1,631 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chio0hai |
'params': {'skip_download': True}
}]
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
data_json = self._parse_json(self._search_regex(r'window\.__SERVER_STATE__\s?=\s?({(?:(?!};)[^"]|"([^"]|\\")*")+})\s?;', webpage, 'data_json'), i... | I'd set formats to this before adding manifests. But not gonna force u tbh
```py
formats = [
{...}
for video in ...
if video.get('$url')])
``` | },
'params': {'skip_download': True}
}]
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
data_json = self._parse_json(self._search_regex(
r'window\.__SERVER_STATE__\s?=\s?({(?:(?!};)[^"]|"([^"]|\\")*")+})\s?;',
... | @@ -0,0 +1,98 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ try_get,
+ unified_strdate,
+)
+
+
+class CanalAlphaIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?canalalpha\.ch/play/[^/]+/[^/]+/(?P<id>\d+)/?.... | yt_dlp/extractor/canalalpha.py | 26 | Python | 0.714 | style | 176 | 38 | 38 | false | [CanalAlpha] Add extractor. | 1,655 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
RCTIPlusTVIE,
)
from .rds import RDSIE
from .redbulltv import (
RedBullTVIE,
RedBullEmbedIE,
RedBullTVRrnContentIE,
RedBullIE,
)
from .reddit import RedditIE
from .redgifs import (
RedGifsIE,
RedGifsSearchIE,
RedGifsUserIE,
)
from .redtube import RedTubeIE
from .regiotv import RegioTVIE
... | use 4 spaces and sort alphabetically | from .rice import RICEIE
from .rmcdecouverte import RMCDecouverteIE
from .ro220 import Ro220IE
from .rockstargames import RockstarGamesIE
from .roosterteeth import RoosterTeethIE, RoosterTeethSeriesIE
from .rottentomatoes import RottenTomatoesIE
from .roxwel import RoxwelIE
from .rozhlas import RozhlasIE
from .rtbf imp... | @@ -1230,7 +1230,13 @@
)
from .rtp import RTPIE
from .rts import RTSIE
-from .rtve import RTVEALaCartaIE, RTVELiveIE, RTVEInfantilIE, RTVELiveIE, RTVETelevisionIE
+from .rtve import (
+ RTVEALaCartaIE,
+ RTVELiveIE,
+ RTVEAudioIE,
+ RTVEInfantilIE,
+ RTVETelevisionIE,
+) | yt_dlp/extractor/extractors.py | 26 | Python | 0.143 | style | 36 | 51 | 51 | false | [rtve] Add support for audio only | 1,657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | kebianizao |
'id': video_id,
'title': title,
'formats': self._extract_png_formats(vidplayer_id),
'is_live': True,
}
class RTVETelevisionIE(InfoExtractor):
IE_NAME = 'rtve.es:television'
_VALID_URL = r'https?://(?:www\.)?rtve\.es/television/[^/]+/[^/]+/(?P<id>\d+).sht... | ```suggestion
'series': try_get(info, lambda x: x['programInfo']['title']),
```
or
```py
'series': traverse_obj(info, ('programInfo', 'title')),
``` | audio_id, 'Downloading url information', query={'q': 'v2'})
q = qualities(['Media', 'Alta', 'HQ', 'HD_READY', 'HD_FULL'])
formats = []
for quality, audio_url in self._decrypt_url(png):
ext = determine_ext(audio_url)
if ext == 'm3u8':
formats.ex... | @@ -178,6 +178,87 @@ def _get_subtitles(self, video_id, sub_file):
for s in subs)
+class RTVEAudioIE(RTVEALaCartaIE):
+ IE_NAME = 'rtve.es:audio'
+ IE_DESC = 'RTVE audio'
+ _VALID_URL = r'https?://(?:www\.)?rtve\.es/(alacarta|play)/audios/[^/]+/[^/]+/(?P<id>[0-9]+)/'
+
+ _TESTS = [{
+ ... | yt_dlp/extractor/rtve.py | 26 | Python | 0.714 | suggestion | 179 | 37 | 51 | false | [rtve] Add support for audio only | 1,657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | kebianizao |
return {
'id': video_id,
'title': title,
'formats': self._extract_png_formats(vidplayer_id),
'is_live': True,
}
class RTVETelevisionIE(InfoExtractor):
IE_NAME = 'rtve.es:television'
_VALID_URL = r'https?://(?:www\.)?rtve\.es/television/[^/]+/[^/]... | ```suggestion
return {
'id': audio_id,
'title': info['title'].strip(),
'thumbnail': info.get('thumbnail'),
'duration': float_or_none(info.get('duration'), 1000),
'series': info.get('programInfo').get('title'),
'formats': self._extrac... | (self._manager, audio_id),
audio_id, 'Downloading url information', query={'q': 'v2'})
q = qualities(['Media', 'Alta', 'HQ', 'HD_READY', 'HD_FULL'])
formats = []
for quality, audio_url in self._decrypt_url(png):
ext = determine_ext(audio_url)
if ex... | @@ -178,6 +178,87 @@ def _get_subtitles(self, video_id, sub_file):
for s in subs)
+class RTVEAudioIE(RTVEALaCartaIE):
+ IE_NAME = 'rtve.es:audio'
+ IE_DESC = 'RTVE audio'
+ _VALID_URL = r'https?://(?:www\.)?rtve\.es/(alacarta|play)/audios/[^/]+/[^/]+/(?P<id>[0-9]+)/'
+
+ _TESTS = [{
+ ... | yt_dlp/extractor/rtve.py | 26 | Python | 0.857 | refactor | 360 | 38 | 51 | false | [rtve] Add support for audio only | 1,657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | kebianizao |
is_live = info.get('live') is True
return {
'id': video_id,
'title': self._live_title(title) if is_live else title,
'formats': formats,
'thumbnail': info.get('image'),
'subtitles': subtitles,
'duration': float_or_none(info.get('dur... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?rtve\.es/(alacarta|play)/audios/[^/]+/[^/]+/(?P<id>[0-9]+)'
``` | is_live = info.get('live') is True
return {
'id': video_id,
'title': self._live_title(title) if is_live else title,
'formats': formats,
'thumbnail': info.get('image'),
'subtitles': subtitles,
'duration': float_or_none(info.get('dur... | @@ -178,6 +179,90 @@ def _get_subtitles(self, video_id, sub_file):
for s in subs)
+class RTVEAudioIE(RTVEALaCartaIE):
+ IE_NAME = 'rtve.es:audio'
+ IE_DESC = 'RTVE audio'
+ _VALID_URL = r'https?://(?:www\.)?rtve\.es/(alacarta|play)/audios/[^/]+/[^/]+/(?P<id>[0-9]+)/' | yt_dlp/extractor/rtve.py | 26 | Python | 0.714 | suggestion | 117 | 51 | 51 | false | [rtve] Add support for audio only | 1,657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | kebianizao |
formats.extend(self._extract_mpd_formats(
audio_url, audio_id, 'dash', fatal=False))
else:
formats.append({
'format_id': quality,
'quality': q(quality),
'url': audio_url,
})
... | none of the tests cover `series` | audio_url, audio_id, 'mp4', 'm3u8_native',
m3u8_id='hls', fatal=False))
elif ext == 'mpd':
formats.extend(self._extract_mpd_formats(
audio_url, audio_id, 'dash', fatal=False))
else:
formats.append({
... | @@ -178,6 +179,90 @@ def _get_subtitles(self, video_id, sub_file):
for s in subs)
+class RTVEAudioIE(RTVEALaCartaIE):
+ IE_NAME = 'rtve.es:audio'
+ IE_DESC = 'RTVE audio'
+ _VALID_URL = r'https?://(?:www\.)?rtve\.es/(alacarta|play)/audios/[^/]+/[^/]+/(?P<id>[0-9]+)/'
+
+ _TESTS = [{
+ ... | yt_dlp/extractor/rtve.py | 26 | Python | 0.214 | suggestion | 32 | 51 | 51 | false | [rtve] Add support for audio only | 1,657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | kebianizao |
fatal=fatal, data=data, headers=headers, query=query)
if res is False:
return [], {}
m3u8_doc, urlh = res
m3u8_url = urlh.geturl()
return self._parse_m3u8_formats_and_subtitles(
m3u8_doc, m3u8_url, ext=ext, entry_protocol=entry_protocol,
... | ```suggestion
has_drm = re.search('|'.join([
r'#EXT-X-FAXS-CM:', # Adobe Flash Access
r'#EXT-X-(?:SESSION-)?KEY:.*?URI="skd://', # Apple FairPlay
], m3u8_doc)
```
is far more readable imo. What do u think? | fatal=fatal, data=data, headers=headers, query=query)
if res is False:
return [], {}
m3u8_doc, urlh = res
m3u8_url = urlh.geturl()
return self._parse_m3u8_formats_and_subtitles(
m3u8_doc, m3u8_url, ext=ext, entry_protocol=entry_protocol,
... | @@ -2035,10 +2035,11 @@ def _parse_m3u8_formats_and_subtitles(
video_id=None):
formats, subtitles = [], {}
- if '#EXT-X-FAXS-CM:' in m3u8_doc: # Adobe Flash Access
- return formats, subtitles
-
- has_drm = re.search(r'#EXT-X-(?:SESSION-)?KEY:.*?URI="skd://', m3u8_doc)
+... | yt_dlp/extractor/common.py | 26 | Python | 0.786 | question | 253 | 51 | 51 | false | [hls] Improve DRM checks | 1,661 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))
man_url = urlh.geturl()
s = urlh.read().decode('utf-8', 'ignore')
can_download, message = self.can_download(s, info_dict, self.params.get('allow_unplayable_formats')), None
if can_download and not compat_pycrypto_AE... | ```suggestion
message = message or 'Unsupported features have been detected'
fd = FFmpegFD(self.ydl, self.params)
self.report_warning(f'{message}; extraction will be delegated to {fd.get_basename()}')
return fd.real_download(filename, info_dict)
``` |
urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))
man_url = urlh.geturl()
s = urlh.read().decode('utf-8', 'ignore')
can_download, message = self.can_download(s, info_dict, self.params.get('allow_unplayable_formats')), None
if can_download and not compat_pycrypto_AE... | @@ -77,10 +77,19 @@ def real_download(self, filename, info_dict):
message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; '
'Decryption will be performed natively, but will be extremely slow')
if not can_download:
- ... | yt_dlp/downloader/hls.py | 26 | Python | 0.857 | refactor | 302 | 51 | 51 | false | [hls] Improve DRM checks | 1,661 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
yield not re.search(feature, manifest)
return all(check_results())
def real_download(self, filename, info_dict):
man_url = info_dict['url']
self.to_screen('[%s] Downloading m3u8 manifest' % self.FD_NAME)
urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))... | ```suggestion
self.report_error(
'This video is DRM protected; Try selecting another format with --format or '
'add --check-formats to automatically fallback to the next best format')
``` | yield not re.search(feature, manifest)
return all(check_results())
def real_download(self, filename, info_dict):
man_url = info_dict['url']
self.to_screen('[%s] Downloading m3u8 manifest' % self.FD_NAME)
urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))... | @@ -77,10 +77,19 @@ def real_download(self, filename, info_dict):
message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; '
'Decryption will be performed natively, but will be extremely slow')
if not can_download:
- ... | yt_dlp/downloader/hls.py | 26 | Python | 0.929 | suggestion | 247 | 51 | 51 | false | [hls] Improve DRM checks | 1,661 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
yield not info_dict.get('is_live')
for feature in UNSUPPORTED_FEATURES:
yield not re.search(feature, manifest)
return all(check_results())
def real_download(self, filename, info_dict):
man_url = info_dict['url']
self.to_screen('[%s] Downloading m3u8 m... | ```suggestion
has_drm = re.search('|'.join([
r'#EXT-X-FAXS-CM:', # Adobe Flash Access
r'#EXT-X-(?:SESSION-)?KEY:.*?URI="skd://', # Apple FairPlay
], s)
``` | yield not info_dict.get('is_live')
for feature in UNSUPPORTED_FEATURES:
yield not re.search(feature, manifest)
return all(check_results())
def real_download(self, filename, info_dict):
man_url = info_dict['url']
self.to_screen('[%s] Downloading m3u8 m... | @@ -77,6 +77,16 @@ def real_download(self, filename, info_dict):
message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; '
'Decryption will be performed natively, but will be extremely slow')
if not can_download:
+ ... | yt_dlp/downloader/hls.py | 26 | Python | 0.786 | suggestion | 218 | 51 | 51 | false | [hls] Improve DRM checks | 1,661 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
def check_results():
yield not info_dict.get('is_live')
for feature in UNSUPPORTED_FEATURES:
yield not re.search(feature, manifest)
return all(check_results())
def real_download(self, filename, info_dict):
man_url = info_dict['url']
self.to_sc... | ```suggestion
]), s)
``` | def check_results():
yield not info_dict.get('is_live')
for feature in UNSUPPORTED_FEATURES:
yield not re.search(feature, manifest)
return all(check_results())
def real_download(self, filename, info_dict):
man_url = info_dict['url']
self.to_sc... | @@ -77,6 +77,15 @@ def real_download(self, filename, info_dict):
message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; '
'Decryption will be performed natively, but will be extremely slow')
if not can_download:
+ ... | yt_dlp/downloader/hls.py | 26 | Python | 0.429 | suggestion | 38 | 51 | 51 | false | [hls] Improve DRM checks | 1,661 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
errnote='Failed to download m3u8 information' if errnote is None else errnote,
fatal=fatal, data=data, headers=headers, query=query)
if res is False:
return [], {}
m3u8_doc, urlh = res
m3u8_url = urlh.geturl()
return self._parse_m3u8_formats_and_sub... | ```suggestion
]), m3u8_doc)
``` | errnote='Failed to download m3u8 information' if errnote is None else errnote,
fatal=fatal, data=data, headers=headers, query=query)
if res is False:
return [], {}
m3u8_doc, urlh = res
m3u8_url = urlh.geturl()
return self._parse_m3u8_formats_and_sub... | @@ -2035,10 +2035,10 @@ def _parse_m3u8_formats_and_subtitles(
video_id=None):
formats, subtitles = [], {}
- if '#EXT-X-FAXS-CM:' in m3u8_doc: # Adobe Flash Access
- return formats, subtitles
-
- has_drm = re.search(r'#EXT-X-(?:SESSION-)?KEY:.*?URI="skd://', m3u8_doc)
+... | yt_dlp/extractor/common.py | 26 | Python | 0.429 | suggestion | 41 | 51 | 51 | false | [hls] Improve DRM checks | 1,661 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
'ARGS are a semicolon ";" delimited list of NAME=VALUE. '
'The "when" argument determines when the postprocessor is invoked. '
'It can be one of "pre_process" (after extraction), '
'"before_dl" (before video download), "post_process" (after video download; default) '
... | `poi_highlight` should not be allowed here, see the comment above. | 'ARGS are a semicolon ";" delimited list of NAME=VALUE. '
'The "when" argument determines when the postprocessor is invoked. '
'It can be one of "pre_process" (after extraction), '
'"before_dl" (before video download), "post_process" (after video download; default) '
... | @@ -1434,20 +1434,28 @@ def _dict_from_options_callback(
sponsorblock.add_option(
'--sponsorblock-mark', metavar='CATS',
dest='sponsorblock_mark', default=set(), action='callback', type='str',
- callback=_set_from_options_callback, callback_kwargs={'allowed_values': SponsorBlockPP.CATEGORI... | yt_dlp/options.py | 26 | Python | 0.429 | suggestion | 66 | 51 | 51 | false | [SponsorBlock]: Support for Filler category | 1,664 | yt-dlp/yt-dlp | 132,642 | Python | nihil-admirari | nihil-admirari |
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_TEST = {
'url': 'https://stripchat.com/feel_me',
... | ```suggestion
'skip': 'Room is offline',
``` | from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_TESTS = [{
'url': 'https://stripchat.com/feel_me',... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 26 | Python | 0.571 | suggestion | 54 | 51 | 51 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
}
_ROOM_OFFLINE = 'Model is offline.'
_ROOM_PRIVATE = 'Model is in private show.'
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://stripchat.com/%s/' % video_id, video_id,
headers=self.geo_verification_heade... | ```suggestion
if try_get(data, lambda x: x['viewCam']['show'], dict):
raise ExtractorError('Model is in private show', expected=True)
elif not try_get(data, lambda x: x['viewCam']['model']['isLive'], bool):
raise ExtractorError('Model is offline', expected=True)
``` | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://stripchat.com/%s/' % video_id, video_id,
headers=self.geo_verification_headers())
data = self._parse_json(
self._search_regex(
r'<scrip... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 26 | Python | 1 | refactor | 311 | 50 | 38 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
video_id, transform_source=lowercase_escape, fatal=False)
if not data:
raise ExtractorError('Unable to find configuration for stream.')
show = try_get(data, lambda x: x['viewCam']['show'], dict)
if show:
raise ExtractorError(self._ROOM_PRIVATE, expected=True)... | ```suggestion
formats = self._extract_m3u8_formats(
'https://b-%s.%s/hls/%d/%d.m3u8' % (server, host, model_id, model_id),
video_id, ext='mp4', m3u8_id='hls', fatal=False, live=True)
self._sort_formats(formats)
``` | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_T... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 26 | Python | 0.857 | refactor | 259 | 35 | 67 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://stripchat.com/%s/' % video_id, video_id,
headers=self.geo_verification_headers())
data = self._parse_json(
self._search_regex(
r'<scri... | Try to use something that is unique to each video as the id | headers=self.geo_verification_headers())
data = self._parse_json(
self._search_regex(
r'<script\b[^>]*>\s*window\.__PRELOADED_STATE__\s*=(?P<value>.*?)<\/script>',
webpage, 'data', default='{}', group='value'),
video_id, transform_source=lower... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 26 | Python | 0.286 | suggestion | 59 | 46 | 34 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
is_live = try_get(data, lambda x: x['viewCam']['model']['isLive'], bool)
if not is_live:
raise ExtractorError(self._ROOM_OFFLINE, expected=True)
server = try_get(data, lambda x: x['viewCam']['viewServers']['flashphoner-hls'], compat_str)
host = try_get(data, lambda x: x['con... | `age_limit` must be set for porn sites (in test as well) | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_T... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 26 | Python | 0.357 | suggestion | 56 | 27 | 67 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_T... | using that regex makes no sense
```suggestion
'description': str,
``` | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_T... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 23 | Python | 0.571 | suggestion | 84 | 48 | 48 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_T... | use `_TESTS = [{...}]`. `_TEST` is legacy interface | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
lowercase_escape,
try_get,
)
class StripchatIE(InfoExtractor):
_VALID_URL = r'https?://stripchat\.com/(?P<id>[0-9A-Za-z-_]+)'
_T... | @@ -0,0 +1,78 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_str,
+)
+from ..utils import (
+ ExtractorError,
+ lowercase_escape,
+ try_get,
+)
+
+
+class StripchatIE(InfoExtractor):
+ _VALID_URL = r'https?://stripchat\.c... | yt_dlp/extractor/stripchat.py | 17 | Python | 0.429 | suggestion | 51 | 42 | 42 | false | [Stripchat] Add extractor | 1,668 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zulaport |
webpage = self._download_webpage(
'https://www.vidlii.com/watch?v=%s' % video_id, video_id)
formats = []
def add_format(format_url, height=None):
try:
height = int(self._search_regex(r"(?P<h>\d\d\d).mp4",
f... | ```py
self._request_webpage(HEADRequest(hdsrc), ...)
``` | webpage = self._download_webpage(
'https://www.vidlii.com/watch?v=%s' % video_id, video_id)
formats = []
sources = [source[1] for source in re.findall(
r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1',
webpage) or []]
for source in sources:
... | @@ -45,10 +67,33 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'https://www.vidlii.com/watch?v=%s' % video_id, video_id)
-
- video_url = self._search_regex(
- r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1', webpage,
- 'video url', grou... | yt_dlp/extractor/vidlii.py | 26 | Python | 0.571 | suggestion | 58 | 51 | 51 | false | [VidLii] Add 720p support | 1,681 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mrpapersonic |
formats = []
def add_format(format_url, height=None):
try:
height = int(self._search_regex(r"(?P<h>\d\d\d).mp4",
format_url, "height",
group="h"))
except Exception:
... | the two regexes are almost identical. This can be generalized |
sources = [source[1] for source in re.findall(
r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1',
webpage) or []]
for source in sources:
height = int(self._search_regex(r'(\d+).mp4', source, 'height', default=360))
if self._request_webpage(HEADReq... | @@ -45,10 +67,33 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'https://www.vidlii.com/watch?v=%s' % video_id, video_id)
-
- video_url = self._search_regex(
- r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1', webpage,
- 'video url', grou... | yt_dlp/extractor/vidlii.py | 26 | Python | 0.214 | suggestion | 61 | 51 | 51 | false | [VidLii] Add 720p support | 1,681 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mrpapersonic |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.