you-get icon indicating copy to clipboard operation
you-get copied to clipboard

The error occurs when trying to use you-get to download Bilibili videos outside of China using a non-Chinese IP.

Open sidouzi123 opened this issue 1 year ago • 13 comments

The error occurs when trying to use you-get to download Bilibili videos outside of China using a non-Chinese IP. There are no issues with Chinese IP addresses before or after the fix. As this is my first time using GitHub, please forgive any formatting errors.

Before the modification:

sidouzi@sdz:~$ you-get --debug "https://b23.tv/BV1yk4y1W7xX"
[DEBUG] get_location: https://b23.tv/BV1yk4y1W7xX
[DEBUG] get_content: https://www.bilibili.com/video/BV1yk4y1W7xX/
[DEBUG] get_content: https://www.bilibili.com/video/BV1yk4y1W7xX/
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=120&type=&otype=json&fnver=0&fnval=16&fourk=1
you-get: version 0.4.1650, a tiny downloader that scrapes the web.
you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='.', player=None, cookies=None, timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://b23.tv/BV1yk4y1W7xX'])
Traceback (most recent call last):
  File "/home/sidouzi/.local/bin/you-get", line 8, in <module>
    sys.exit(main())
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/__main__.py", line 92, in main
    main(**kwargs)
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/common.py", line 1870, in main
    script_main(any_download, any_download_playlist, **kwargs)
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/common.py", line 1762, in script_main
    download_main(
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/common.py", line 1382, in download_main
    download(url, **kwargs)
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/common.py", line 1861, in any_download
    m.download(url, **kwargs)
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/extractor.py", line 48, in download_by_url
    self.prepare(**kwargs)
  File "/home/sidouzi/.local/lib/python3.10/site-packages/you_get/extractors/bilibili.py", line 273, in prepare
    message = api_playinfo['data']['message']
KeyError: 'data'

After the modification:

sidouzi@sdz:~$ you-get --debug "https://b23.tv/BV1yk4y1W7xX"
[DEBUG] get_location: https://b23.tv/BV1yk4y1W7xX
[DEBUG] get_content: https://www.bilibili.com/video/BV1yk4y1W7xX/
[DEBUG] get_content: https://www.bilibili.com/video/BV1yk4y1W7xX/
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=120&type=&otype=json&fnver=0&fnval=16&fourk=1
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=1146077095&otype=json&qn=120&quality=120&type=&sign=9dc49d7ca85444ea03f2c12b0e19c249
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=112&type=&otype=json&fnver=0&fnval=16&fourk=1
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=1146077095&otype=json&qn=112&quality=112&type=&sign=07f0780ca903dd889b0f36c5a4845476
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=80&type=&otype=json&fnver=0&fnval=16&fourk=1
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=1146077095&otype=json&qn=80&quality=80&type=&sign=7053d22c7d6023508052f9221dfa33be
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=64&type=&otype=json&fnver=0&fnval=16&fourk=1
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=1146077095&otype=json&qn=64&quality=64&type=&sign=08efd2c9094638f34e2975e99d91d02b
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=32&type=&otype=json&fnver=0&fnval=16&fourk=1
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=1146077095&otype=json&qn=32&quality=32&type=&sign=1695fb2bbc483d773d7e7136358eaa00
[DEBUG] get_content: https://api.bilibili.com/x/player/playurl?avid=741737386&cid=1146077095&qn=16&type=&otype=json&fnver=0&fnval=16&fourk=1
[DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=1146077095&otype=json&qn=16&quality=16&type=&sign=e4cfa9e44e07cb2de9433d4ba9e724cb
[DEBUG] get_content: http://comment.bilibili.com/1146077095.xml
site:                Bilibili
title:               打工是不可能打工的
stream:
    - format:        flv360
      container:     flv
      quality:       流畅 360P
      size:          3.6 MiB (3820632 bytes)
    # download-with: you-get --format=flv360 [URL]

Downloading 打工是不可能打工的.flv ...
 100% (  3.6/  3.6MB) ├████████████████████████████████████████████████████████████████████████████████┤[1/1]   35 MB/s

Downloading 打工是不可能打工的.cmt.xml ...

sidouzi123 avatar Jun 01 '23 03:06 sidouzi123

Hello @sidouzi123, Thanks for the Pull Request. We :heart: our contributors! Please wait for one of our human maintainers to review your patches. This may take a few days to weeks. Also, please understand that although your Pull Request may or may not be eventually merged, we value all contributions equally.

祝您健康!

soimort-bot avatar Jun 01 '23 03:06 soimort-bot

C:\Users\weitaifu>pip install --upgrade you-get Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: you-get in c:\users\weitaifu\appdata\local\programs\python\python312\lib\site-packages (0.4.1650)

[notice] A new release of pip is available: 23.3.1 -> 23.3.2 [notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\weitaifu>python.exe -m pip install --upgrade pip Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: pip in c:\users\weitaifu\appdata\local\programs\python\python312\lib\site-packages (23.3.1) Collecting pip Downloading https://pypi.tuna.tsinghua.edu.cn/packages/15/aa/3f4c7bcee2057a76562a5b33ecbd199be08cdb4443a02e26bd2c3cf6fc39/pip-23.3.2-py3-none-any.whl (2.1 MB) ---------------------------------------- 2.1/2.1 MB 3.5 MB/s eta 0:00:00 Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 23.3.1 Uninstalling pip-23.3.1: Successfully uninstalled pip-23.3.1 Successfully installed pip-23.3.2

C:\Users\weitaifu>you-get -o G:\下载 https://www.bilibili.com/video/BV1UT4y1P7Mf you-get: [error] oops, something went wrong. you-get: don't panic, c'est la vie. please try the following steps: you-get: (1) Rule out any network problem. you-get: (2) Make sure you-get is up-to-date. you-get: (3) Check if the issue is already known, on you-get: https://github.com/soimort/you-get/wiki/Known-Bugs you-get: https://github.com/soimort/you-get/issues you-get: (4) Run the command with '--debug' option, you-get: and report this issue with the full output.

C:\Users\weitaifu>you-get -o G:\下载 https://www.bilibili.com/video/BV1UT4y1P7Mf --debug [DEBUG] get_content: https://www.bilibili.com/video/BV1UT4y1P7Mf [DEBUG] get_content: https://www.bilibili.com/video/BV1UT4y1P7Mf [DEBUG] get_content: https://interface.bilibili.com/v2/playurl?appkey=iVGUTjsxvpLeuDCf&cid=289482292&otype=json&qn=64&quality=64&type=&sign=b4527ec4101a5d3b33cc0a72070a40f1 [DEBUG] HTTP Error with code502 [DEBUG] HTTP Error with code502 [DEBUG] HTTP Error with code502 you-get: version 0.4.1650, a tiny downloader that scrapes the web. you-get: Namespace(version=False, help=False, info=False, url=False, json=False, no_merge=False, no_caption=False, postfix=False, force=False, skip_existing_file_size_check=False, format=None, output_filename=None, output_dir='G:\下载', player=None, cookies=None, timeout=600, debug=True, input_file=None, password=None, playlist=False, first=None, last=None, size=None, auto_rename=False, insecure=False, http_proxy=None, extractor_proxy=None, no_proxy=False, socks_proxy=None, stream=None, itag=None, m3u8=False, URL=['https://www.bilibili.com/video/BV1UT4y1P7Mf']) Traceback (most recent call last): File "", line 198, in run_module_as_main File "", line 88, in run_code File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Scripts\you-get.exe_main.py", line 7, in File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get_main.py", line 92, in main main(**kwargs) File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 1870, in main script_main(any_download, any_download_playlist, **kwargs) File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 1762, in script_main download_main( File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 1382, in download_main download(url, **kwargs) File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 1861, in any_download m.download(url, **kwargs) File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\extractor.py", line 48, in download_by_url self.prepare(**kwargs) File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\extractors\bilibili.py", line 276, in prepare api_content = get_content(api_url, headers=self.bilibili_headers(referer=self.url)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 477, in get_content response = urlopen_with_retry(req) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 446, in urlopen_with_retry raise http_error File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\site-packages\you_get\common.py", line 437, in urlopen_with_retry return request.urlopen(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 215, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 521, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 630, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 559, in error return self._call_chain(*args) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 492, in _call_chain result = func(*args) ^^^^^^^^^^^ File "C:\Users\weitaifu\AppData\Local\Programs\Python\Python312\Lib\urllib\request.py", line 639, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 502: Bad Gateway

weitaifu avatar Dec 27 '23 10:12 weitaifu

i got the same problem!!! Can it fix ???

bigbigtooth avatar Jan 08 '24 16:01 bigbigtooth

我做不到,也没找到解决方法。


发件人: bigbigtooth @.> 发送时间: 2024年1月9日 0:55 收件人: soimort/you-get @.> 抄送: 魏太福 @.>; Comment @.> 主题: Re: [soimort/you-get] The error occurs when trying to use you-get to download Bilibili videos outside of China using a non-Chinese IP. (PR #3010)

i got the same problem!!! Can it fix ???

― Reply to this email directly, view it on GitHubhttps://github.com/soimort/you-get/pull/3010#issuecomment-1881469033, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZBQPUON45EROYFRYHVGJNLYNQQJVAVCNFSM6AAAAAAYWJ5N32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBRGQ3DSMBTGM. You are receiving this because you commented.Message ID: @.***>

weitaifu avatar Jan 14 '24 03:01 weitaifu

+1 遇到同样的问题,解决了吗?

chh-wang avatar Jan 30 '24 10:01 chh-wang

没有

从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送


发件人: chh.wang @.> 发送时间: Tuesday, January 30, 2024 6:20:23 PM 收件人: soimort/you-get @.> 抄送: 魏太福 @.>; Comment @.> 主题: Re: [soimort/you-get] The error occurs when trying to use you-get to download Bilibili videos outside of China using a non-Chinese IP. (PR #3010)

+1 遇到同样的问题,解决了吗?

― Reply to this email directly, view it on GitHubhttps://github.com/soimort/you-get/pull/3010#issuecomment-1916522446, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZBQPUJAHF4Q6FU5WQXGNULYRDCOPAVCNFSM6AAAAAAYWJ5N32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGUZDENBUGY. You are receiving this because you commented.Message ID: @.***>

weitaifu avatar Jan 30 '24 11:01 weitaifu

我没有解决,没有那个能力。请问我怎么使用您的方法解决我的问题?

从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送


发件人: sidouzi123 @.> 发送时间: Saturday, February 3, 2024 10:25:33 AM 收件人: soimort/you-get @.> 抄送: 魏太福 @.>; Comment @.> 主题: Re: [soimort/you-get] The error occurs when trying to use you-get to download Bilibili videos outside of China using a non-Chinese IP. (PR #3010)

+1 遇到同样的问题,解决了吗?

我的fork里已经修复了此问题 但是开发者一直未合并 可以在我fork里使用解决好的方案

― Reply to this email directly, view it on GitHubhttps://github.com/soimort/you-get/pull/3010#issuecomment-1925025320, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZBQPUMASDCRTW543QY25WLYRWNZ3AVCNFSM6AAAAAAYWJ5N32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRVGAZDKMZSGA. You are receiving this because you commented.Message ID: @.***>

weitaifu avatar Feb 03 '24 03:02 weitaifu

I get error 502 even without using any proxy!!! How cans I fix it?

ZreXoc avatar Feb 07 '24 02:02 ZreXoc

update to the lastest develop version (download from github)

demerspring avatar Mar 07 '24 11:03 demerspring

@韦太福 你怎么解决这个问题的?

Metasymbols avatar Mar 08 '24 16:03 Metasymbols

i meet the same problem too!!!!how to fix it?

Pluto-fl-hr avatar Apr 03 '24 16:04 Pluto-fl-hr

使用you-get下载视频时出错,报错是[error] oops, something went wrong.,确认视频地址是正确的 微信截图_20240701120816

correc avatar Jul 01 '24 04:07 correc

Mine is running very well. https://www.youtubemp3dl.com/

letsgits avatar Aug 25 '24 12:08 letsgits