Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c22b2bc

Browse files
committed
plugins.youtube: replace "gaming" with "www" subdomain
closes streamlink#2245
1 parent 42b8edd commit c22b2bc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/streamlink/plugins/youtube.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
import re
66

7-
from streamlink.compat import parse_qsl, is_py2
7+
from streamlink.compat import is_py2, parse_qsl, urlparse, urlunparse
88
from streamlink.plugin import Plugin, PluginError, PluginArguments, PluginArgument
99
from streamlink.plugin.api import validate, useragents
1010
from streamlink.plugin.api.utils import itertags, parse_query
@@ -165,6 +165,10 @@ class YouTube(Plugin):
165165

166166
def __init__(self, url):
167167
super(YouTube, self).__init__(url)
168+
parsed = urlparse(self.url)
169+
if parsed.netloc == 'gaming.youtube.com':
170+
self.url = urlunparse(parsed._replace(netloc='www.youtube.com'))
171+
168172
self.author = None
169173
self.title = None
170174
self.video_id = None

0 commit comments

Comments
 (0)