mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 02:42:30 +00:00
[ie/abematv] Fix proxy handling (#8046)
Fixes https://github.com/yt-dlp/yt-dlp/issues/8036 Authored by: SevenLives
This commit is contained in:
parent
7b71643cc9
commit
497bbbbd73
@ -12,7 +12,7 @@
|
|||||||
import urllib.request
|
import urllib.request
|
||||||
import urllib.response
|
import urllib.response
|
||||||
import uuid
|
import uuid
|
||||||
|
from ..utils.networking import clean_proxies
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..aes import aes_ecb_decrypt
|
from ..aes import aes_ecb_decrypt
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
@ -35,7 +35,10 @@ def add_opener(ydl, handler): # FIXME: Create proper API in .networking
|
|||||||
rh = ydl._request_director.handlers['Urllib']
|
rh = ydl._request_director.handlers['Urllib']
|
||||||
if 'abematv-license' in rh._SUPPORTED_URL_SCHEMES:
|
if 'abematv-license' in rh._SUPPORTED_URL_SCHEMES:
|
||||||
return
|
return
|
||||||
opener = rh._get_instance(cookiejar=ydl.cookiejar, proxies=ydl.proxies)
|
headers = ydl.params['http_headers'].copy()
|
||||||
|
proxies = ydl.proxies.copy()
|
||||||
|
clean_proxies(proxies, headers)
|
||||||
|
opener = rh._get_instance(cookiejar=ydl.cookiejar, proxies=proxies)
|
||||||
assert isinstance(opener, urllib.request.OpenerDirector)
|
assert isinstance(opener, urllib.request.OpenerDirector)
|
||||||
opener.add_handler(handler)
|
opener.add_handler(handler)
|
||||||
rh._SUPPORTED_URL_SCHEMES = (*rh._SUPPORTED_URL_SCHEMES, 'abematv-license')
|
rh._SUPPORTED_URL_SCHEMES = (*rh._SUPPORTED_URL_SCHEMES, 'abematv-license')
|
||||||
|
Loading…
Reference in New Issue
Block a user