projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[youtube] Add more invidious instances to _VALID_URL (#21694)
[youtube-dl]
/
youtube_dl
/
extractor
/
youtube.py
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index b570d5bae9b6128afb544e16fc9aef292e64fa01..762611b89f5982c2c8273a07ffedfae0cba813c2 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-27,6
+27,7
@@
from ..compat import (
compat_str,
)
from ..utils import (
compat_str,
)
from ..utils import (
+ bool_or_none,
clean_html,
dict_get,
error_to_compat_str,
clean_html,
dict_get,
error_to_compat_str,
@@
-116,6
+117,8
@@
class YoutubeBaseInfoExtractor(InfoExtractor):
'f.req': json.dumps(f_req),
'flowName': 'GlifWebSignIn',
'flowEntry': 'ServiceLogin',
'f.req': json.dumps(f_req),
'flowName': 'GlifWebSignIn',
'flowEntry': 'ServiceLogin',
+ # TODO: reverse actual botguard identifier generation algo
+ 'bgRequest': '["identifier",""]',
})
return self._download_json(
url, None, note=note, errnote=errnote,
})
return self._download_json(
url, None, note=note, errnote=errnote,
@@
-368,10
+371,14
@@
class YoutubeIE(YoutubeBaseInfoExtractor):
(?:www\.)?hooktube\.com/|
(?:www\.)?yourepeat\.com/|
tube\.majestyc\.net/|
(?:www\.)?hooktube\.com/|
(?:www\.)?yourepeat\.com/|
tube\.majestyc\.net/|
+ # Invidious instances taken from https://github.com/omarroth/invidious/wiki/Invidious-Instances
(?:(?:www|dev)\.)?invidio\.us/|
(?:(?:www|dev)\.)?invidio\.us/|
- (?:
www
\.)?invidiou\.sh/|
- (?:
www
\.)?invidious\.snopyta\.org/|
+ (?:
(?:www|no)
\.)?invidiou\.sh/|
+ (?:
(?:www|fi|de)
\.)?invidious\.snopyta\.org/|
(?:www\.)?invidious\.kabi\.tk/|
(?:www\.)?invidious\.kabi\.tk/|
+ (?:www\.)?invidious\.enkirton\.net/|
+ (?:www\.)?invidious\.13ad\.de/|
+ (?:www\.)?tube\.poal\.co/|
(?:www\.)?vid\.wxzm\.sx/|
youtube\.googleapis\.com/) # the various hostnames, with wildcard subdomains
(?:.*?\#/)? # handle anchor (#/) redirect urls
(?:www\.)?vid\.wxzm\.sx/|
youtube\.googleapis\.com/) # the various hostnames, with wildcard subdomains
(?:.*?\#/)? # handle anchor (#/) redirect urls
@@
-1888,6
+1895,11
@@
class YoutubeIE(YoutubeBaseInfoExtractor):
if view_count is None and video_details:
view_count = int_or_none(video_details.get('viewCount'))
if view_count is None and video_details:
view_count = int_or_none(video_details.get('viewCount'))
+ if is_live is None:
+ is_live = bool_or_none(dict_get(
+ video_details, ('isLive', 'isLiveContent'),
+ skip_false_values=False))
+
# Check for "rental" videos
if 'ypc_video_rental_bar_text' in video_info and 'author' not in video_info:
raise ExtractorError('"rental" videos not supported. See https://github.com/ytdl-org/youtube-dl/issues/359 for more information.', expected=True)
# Check for "rental" videos
if 'ypc_video_rental_bar_text' in video_info and 'author' not in video_info:
raise ExtractorError('"rental" videos not supported. See https://github.com/ytdl-org/youtube-dl/issues/359 for more information.', expected=True)