Skip to content

Commit

Permalink
[ie/abematv] Fix proxy handling (yt-dlp#8046)
Browse files Browse the repository at this point in the history
Fixes yt-dlp#8036

Authored by: SevenLives
  • Loading branch information
SevenLives authored Sep 16, 2023
1 parent 7b71643 commit 497bbbb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions yt_dlp/extractor/abematv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import urllib.request
import urllib.response
import uuid

from ..utils.networking import clean_proxies
from .common import InfoExtractor
from ..aes import aes_ecb_decrypt
from ..utils import (
Expand All @@ -35,7 +35,10 @@ def add_opener(ydl, handler): # FIXME: Create proper API in .networking
rh = ydl._request_director.handlers['Urllib']
if 'abematv-license' in rh._SUPPORTED_URL_SCHEMES:
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)
opener.add_handler(handler)
rh._SUPPORTED_URL_SCHEMES = (*rh._SUPPORTED_URL_SCHEMES, 'abematv-license')
Expand Down

0 comments on commit 497bbbb

Please sign in to comment.