mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-22 02:01:50 +00:00
[youtube] Fix videos with restricted location (closes #28685)
This commit is contained in:
parent
70d0d4f9be
commit
6b116f0c03
1 changed files with 24 additions and 1 deletions
|
@ -1084,6 +1084,23 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||||
'url': 'https://www.youtube.com/watch?v=nGC3D_FkCmg',
|
'url': 'https://www.youtube.com/watch?v=nGC3D_FkCmg',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
# restricted location, https://github.com/ytdl-org/youtube-dl/issues/28685
|
||||||
|
'url': 'cBvYw8_A0vQ',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'cBvYw8_A0vQ',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '4K Ueno Okachimachi Street Scenes 上野御徒町歩き',
|
||||||
|
'description': 'md5:ea770e474b7cd6722b4c95b833c03630',
|
||||||
|
'upload_date': '20201120',
|
||||||
|
'uploader': 'Walk around Japan',
|
||||||
|
'uploader_id': 'UC3o_t8PzBmXf5S9b7GLx1Mw',
|
||||||
|
'uploader_url': r're:https?://(?:www\.)?youtube\.com/channel/UC3o_t8PzBmXf5S9b7GLx1Mw',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
_formats = {
|
_formats = {
|
||||||
'5': {'ext': 'flv', 'width': 400, 'height': 240, 'acodec': 'mp3', 'abr': 64, 'vcodec': 'h263'},
|
'5': {'ext': 'flv', 'width': 400, 'height': 240, 'acodec': 'mp3', 'abr': 64, 'vcodec': 'h263'},
|
||||||
|
@ -1485,7 +1502,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||||
def get_text(x):
|
def get_text(x):
|
||||||
if not x:
|
if not x:
|
||||||
return
|
return
|
||||||
return x.get('simpleText') or ''.join([r['text'] for r in x['runs']])
|
text = x.get('simpleText')
|
||||||
|
if text and isinstance(text, compat_str):
|
||||||
|
return text
|
||||||
|
runs = x.get('runs')
|
||||||
|
if not isinstance(runs, list):
|
||||||
|
return
|
||||||
|
return ''.join([r['text'] for r in runs if isinstance(r.get('text'), compat_str)])
|
||||||
|
|
||||||
search_meta = (
|
search_meta = (
|
||||||
lambda x: self._html_search_meta(x, webpage, default=None)) \
|
lambda x: self._html_search_meta(x, webpage, default=None)) \
|
||||||
|
|
Loading…
Reference in a new issue