Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbemaTV: failing to download with recent nightly version #7622

Closed
9 of 11 tasks
xtkoba opened this issue Jul 17, 2023 · 5 comments
Closed
9 of 11 tasks

AbemaTV: failing to download with recent nightly version #7622

xtkoba opened this issue Jul 17, 2023 · 5 comments
Labels
patch-available There is patch available that should fix this issue. Someone needs to make a PR with it regression Works in youtube-dl/older yt-dlp site-bug Issue with a specific website

Comments

@xtkoba
Copy link
Contributor

xtkoba commented Jul 17, 2023

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

Japan

Provide a description that is worded well enough to be understood

The AbemaTV extractor fails to download a video with nightly@2023.07.15.211025.

ERROR: Unable to handle request: Unsupported url scheme: "abematv-license" (urllib)

I have confirmed that the same video can be downloded with 2023.07.06.

I suspect this is something related to commit 227bf1a.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', 'https://abema.tv/video/episode/194-25_s2_p1']
[debug] Encodings: locale utf-8, fs utf-8, pref utf-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version nightly@2023.07.15.211025 [613dbce17]
[debug] Python 3.11.4 (CPython armv7l 32bit) - Linux-3.10.49-g12ec2e6-00359-g4edd381-armv7l-with-libc (OpenSSL 3.0.9 30 May 2023, libc)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: certifi-2023.05.07, mutagen-1.46.0, pycrypto-3.18.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Available version: nightly@2023.07.15.211025, Current version: nightly@2023.07.15.211025
yt-dlp is up to date (nightly@2023.07.15.211025)
[AbemaTV] Extracting URL: https://abema.tv/video/episode/194-25_s2_p1
[AbemaTV] Authorizing
ERROR: YoutubeDL._opener() is deprecated, use YoutubeDL.urlopen(); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/__main__.py", line 17, in <module>
    yt_dlp.main()
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/__init__.py", line 1008, in main
    _exit(*variadic(_real_main(argv)))
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/__init__.py", line 998, in _real_main
    return ydl.download(all_urls)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3518, in download
    self.__download_wrapper(self.extract_info)(
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3493, in wrapper
    res = func(*args, **kwargs)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1565, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1576, in wrapper
    return func(self, *args, **kwargs)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1711, in __extract_info
    ie_result = ie.extract(url)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 715, in extract
    ie_result = self._real_extract(url)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/extractor/abematv.py", line 344, in _real_extract
    'Authorization': 'Bearer ' + self._get_device_token(),
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/extractor/abematv.py", line 216, in _get_device_token
    remove_opener(self._downloader, AbemaLicenseHandler)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/extractor/abematv.py", line 49, in remove_opener
    opener = ydl._opener
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 4034, in _opener
    self.deprecation_warning('YoutubeDL._opener() is deprecated, use YoutubeDL.urlopen()')
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1041, in deprecation_warning
    deprecation_warning(
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 1429, in deprecation_warning
    return printer(f'{msg}{bug_reports_message()}', **kwargs)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1054, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 982, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

[AbemaTV] 194-25_s2_p1: Downloading webpage
[AbemaTV] 194-25_s2_p1: Checking playability
[AbemaTV] 194-25_s2_p1: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 194-25_s2_p1: Downloading 1 format(s): 5300
[debug] Invoking hlsnative downloader on "https://vod-abematv.akamaized.net/program/194-25_s2_p1/1080/playlist.m3u8?aver=1"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 257
[download] Destination: 第1話 「チーズケーキ」 「モーニング再び」 [194-25_s2_p1].mp4
[download] 第1話 「チーズケーキ」 「モーニング再び」 [194-25_s2_p1].mp4.part-Frag1 has already been downloaded

[download]   0.4% of ~ 693.38MiB at   30.49MiB/s ETA Unknown (frag 1/257)ERROR: Unable to handle request: Unsupported url scheme: "abematv-license" (urllib)
Traceback (most recent call last):
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1576, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1732, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1791, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 2930, in process_video_result
    self.process_info(new_info)
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3396, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3117, in dl
    return fd.download(name, new_info, subtitle)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/common.py", line 455, in download
    ret = self.real_download(filename, info_dict)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/hls.py", line 375, in real_download
    return self.download_and_append_fragments(ctx, fragments, info_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/fragment.py", line 526, in download_and_append_fragments
    decrypt_fragment(fragment, self._read_fragment(ctx)), fragment['frag_index'], ctx)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/fragment.py", line 367, in decrypt_fragment
    or _get_key(traverse_obj(info_dict, ('hls_aes', 'uri')) or decrypt_info['URI']))
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/fragment.py", line 356, in _get_key
    _key_cache[url] = self.ydl.urlopen(self._prepare_url(info_dict, url)).read()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 4059, in urlopen
    return self._request_director.send(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/user/0/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/common.py", line 102, in send
    raise NoSupportingHandlers(unsupported_errors, unexpected_errors)
yt_dlp.networking.exceptions.NoSupportingHandlers: Unable to handle request: Unsupported url scheme: "abematv-license" (urllib)
@xtkoba xtkoba added site-bug Issue with a specific website triage Untriaged issue labels Jul 17, 2023
@pukkandan pukkandan added the regression Works in youtube-dl/older yt-dlp label Jul 17, 2023
@coletdjnz
Copy link
Member

coletdjnz commented Jul 17, 2023

AbemaTV will need a rewrite for the new networking framework, as initially planned when the extractor was being written (see #3615). The current implementation is temporary and expected to not be compatible.

For a workaround we could add abematv-license to urllib handler known url schemes, however this isn't guaranteed to work as we may have multiple urllib sessions and abema only registers its urllib handlers to one of them.

@pukkandan pukkandan removed the triage Untriaged issue label Jul 17, 2023
@pukkandan
Copy link
Member

Would you be able to check whether this works around the issue?

diff --git a/yt_dlp/extractor/abematv.py b/yt_dlp/extractor/abematv.py
index 98ece8da7..f849d859a 100644
--- a/yt_dlp/extractor/abematv.py
+++ b/yt_dlp/extractor/abematv.py
@@ -34,8 +34,13 @@ def add_opener(ydl, handler):
     ''' Add a handler for opening URLs, like _download_webpage '''
     # https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L426
     # https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L605
-    assert isinstance(ydl._opener, urllib.request.OpenerDirector)
-    ydl._opener.add_handler(handler)
+    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)
+    assert isinstance(opener, urllib.request.OpenerDirector)
+    opener.add_handler(handler)
+    rh._SUPPORTED_URL_SCHEMES = (*rh._SUPPORTED_URL_SCHEMES, 'abematv-license')


 def remove_opener(ydl, handler):
@@ -212,8 +217,6 @@ def _get_device_token(self):
             })
         AbemaTVBaseIE._USERTOKEN = user_data['token']

-        # don't allow adding it 2 times or more, though it's guarded
-        remove_opener(self._downloader, AbemaLicenseHandler)
         add_opener(self._downloader, AbemaLicenseHandler(self))

         return self._USERTOKEN

@pukkandan pukkandan added the needs-testing Patch needs testing label Jul 17, 2023
@xtkoba
Copy link
Contributor Author

xtkoba commented Jul 17, 2023

The patch proposed in #7622 (comment) does not fix the issue due to another error.

[debug] Command-line config: ['-v', 'https://abema.tv/video/episode/194-25_s2_p1']
[debug] Encodings: locale utf-8, fs utf-8, pref utf-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
[debug] yt-dlp version nightly@2023.07.15.211025 [613dbce17]
[debug] Python 3.11.4 (CPython armv7l 32bit) - Linux-3.10.49-armv7l-with-libc (OpenSSL 3.0.9 30 May 2023, libc)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: certifi-2023.05.07, mutagen-1.46.0, pycrypto-3.18.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[AbemaTV] Extracting URL: https://abema.tv/video/episode/194-25_s2_p1
[AbemaTV] Authorizing
[AbemaTV] 194-25_s2_p1: Downloading webpage
[AbemaTV] 194-25_s2_p1: Checking playability
[AbemaTV] 194-25_s2_p1: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 194-25_s2_p1: Downloading 1 format(s): 5300
[debug] Invoking hlsnative downloader on "https://vod-abematv.akamaized.net/program/194-25_s2_p1/1080/playlist.m3u8?aver=1"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 257
[download] Destination: 第1話 「チーズケーキ」 「モーニング再び」 [194-25_s2_p1].mp4
[download] 第1話 「チーズケーキ」 「モーニング再び」 [194-25_s2_p1].mp4.part-Frag1 has already been downloaded

[download]   0.4% of ~ 693.38MiB at   34.74MiB/s ETA Unknown (frag 1/257)[AbemaTV] Fetching media token
[AbemaTV] Requesting playback license
ERROR: [urllib] Unexpected error: TypeError: sequence item 0: expected str instance, int found; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
Traceback (most recent call last):
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/common.py", line 89, in send
    response = handler.send(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/_helper.py", line 203, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/common.py", line 297, in send
    return self._send(request)
           ^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/_urllib.py", line 458, in _send
    return UrllibResponseAdapter(res)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/_urllib.py", line 345, in __init__
    super().__init__(
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/common.py", line 473, in __init__
    self.headers.add_header(name, value)
  File "/data/data/com.example.ytdlp/files/lib/python3.11/email/message.py", line 570, in add_header
    self[_name] = SEMISPACE.join(parts)
                  ^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found

ERROR: Unable to handle request: 1 unexpected error(s)
Traceback (most recent call last):
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1576, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1732, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1791, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 2930, in process_video_result
    self.process_info(new_info)
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3396, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3117, in dl
    return fd.download(name, new_info, subtitle)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/common.py", line 455, in download
    ret = self.real_download(filename, info_dict)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/hls.py", line 375, in real_download
    return self.download_and_append_fragments(ctx, fragments, info_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/fragment.py", line 526, in download_and_append_fragments
    decrypt_fragment(fragment, self._read_fragment(ctx)), fragment['frag_index'], ctx)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/fragment.py", line 367, in decrypt_fragment
    or _get_key(traverse_obj(info_dict, ('hls_aes', 'uri')) or decrypt_info['URI']))
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/downloader/fragment.py", line 356, in _get_key
    _key_cache[url] = self.ydl.urlopen(self._prepare_url(info_dict, url)).read()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 4059, in urlopen
    return self._request_director.send(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.example.ytdlp/files/lib/python3.11/site-packages/yt_dlp/networking/common.py", line 102, in send
    raise NoSupportingHandlers(unsupported_errors, unexpected_errors)
yt_dlp.networking.exceptions.NoSupportingHandlers: Unable to handle request: 1 unexpected error(s)

@bashonly
Copy link
Member

@xtkoba Try this slightly improved patch:

diff --git a/yt_dlp/extractor/abematv.py b/yt_dlp/extractor/abematv.py
index 98ece8da7..6b1f4da88 100644
--- a/yt_dlp/extractor/abematv.py
+++ b/yt_dlp/extractor/abematv.py
@@ -34,8 +34,13 @@ def add_opener(ydl, handler):
     ''' Add a handler for opening URLs, like _download_webpage '''
     # https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L426
     # https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L605
-    assert isinstance(ydl._opener, urllib.request.OpenerDirector)
-    ydl._opener.add_handler(handler)
+    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)
+    assert isinstance(opener, urllib.request.OpenerDirector)
+    opener.add_handler(handler)
+    rh._SUPPORTED_URL_SCHEMES = (*rh._SUPPORTED_URL_SCHEMES, 'abematv-license')
 
 
 def remove_opener(ydl, handler):
@@ -140,7 +145,7 @@ def abematv_license_open(self, url):
         ticket = urllib.parse.urlparse(url).netloc
         response_data = self._get_videokey_from_ticket(ticket)
         return urllib.response.addinfourl(io.BytesIO(response_data), headers={
-            'Content-Length': len(response_data),
+            'Content-Length': str(len(response_data)),
         }, url=url, code=200)
 
 
@@ -212,8 +217,6 @@ def _get_device_token(self):
             })
         AbemaTVBaseIE._USERTOKEN = user_data['token']
 
-        # don't allow adding it 2 times or more, though it's guarded
-        remove_opener(self._downloader, AbemaLicenseHandler)
         add_opener(self._downloader, AbemaLicenseHandler(self))
 
         return self._USERTOKEN

@xtkoba
Copy link
Contributor Author

xtkoba commented Jul 17, 2023

#7622 (comment) This works. Thanks.

@bashonly bashonly added patch-available There is patch available that should fix this issue. Someone needs to make a PR with it and removed needs-testing Patch needs testing labels Jul 17, 2023
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-available There is patch available that should fix this issue. Someone needs to make a PR with it regression Works in youtube-dl/older yt-dlp site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

4 participants