miyouzi / aniGamerPlus

巴哈姆特動畫瘋自動下載工具,支援命令行
GNU General Public License v3.0
677 stars 93 forks source link

抓取sn失敗 ERROR #215

Closed gn556188 closed 1 year ago

gn556188 commented 1 year ago

問題描述

昨天還能下載 今天就不能了

把檔案完全清除 下載最新版本 還是不能 沒使用代理 沒掛過VPN#

錯誤截圖

# 未命名 #

config.json 配置

#{
    "bangumi_dir": "",
    "temp_dir": "",
    "classify_bangumi": true,
    "check_frequency": 5,
    "download_resolution": "1080",
    "lock_resolution": false,
    "only_use_vip": false,
    "default_download_mode": "latest",
    "use_copyfile_method": false,
    "multi-thread": 1,
    "multi_upload": 3,
    "segment_download_mode": true,
    "multi_downloading_segment": 2,
    "segment_max_retry": 8,
    "add_bangumi_name_to_video_filename": true,
    "add_resolution_to_video_filename": true,
    "customized_video_filename_prefix": "【動畫瘋】",
    "customized_bangumi_name_suffix": "",
    "customized_video_filename_suffix": "",
    "video_filename_extension": "mp4",
    "zerofill": 1,
    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36",
    "use_proxy": false,
    "proxy": "http://user:passwd@example.com:1000",
    "upload_to_server": false,
    "ftp": {
        "server": "",
        "port": "",
        "user": "",
        "pwd": "",
        "tls": true,
        "cwd": "",
        "show_error_detail": false,
        "max_retry_num": 15
    },
    "user_command": "shutdown -s -t 60",
    "coolq_notify": false,
    "coolq_settings": {
        "msg_argument_name": "message",
        "message_suffix": "追加的資訊",
        "query": [
            "http://127.0.0.1:5700/send_group_msg?access_token=abc&group_id=12345678",
            "http://127.0.0.1:5700/send_group_msg?access_token=abc&group_id=87654321"
        ]
    },
    "faststart_movflags": false,
    "audio_language": false,
    "use_mobile_api": false,
    "danmu": false,
    "check_latest_version": true,
    "read_sn_list_when_checking_update": true,
    "read_config_when_checking_update": true,
    "ads_time": 25,
    "mobile_ads_time": 3,
    "use_dashboard": true,
    "dashboard": {
        "host": "127.0.0.1",
        "port": 5000,
        "SSL": false,
        "BasicAuth": false,
        "username": "admin",
        "password": "admin"
    },
    "save_logs": true,
    "quantity_of_logs": 7,
    "config_version": 13.0,
    "database_version": 2.0
}#

sn_list.txt 配置

#31703#

2022-10-28.log web.log

miyouzi commented 1 year ago

你用瀏覽器看下動畫瘋能不能打開,然後改下UA

改UA可以看這邊的説明:https://github.com/miyouzi/aniGamerPlus#%E6%8E%A8%E8%96%A6%E8%87%AA%E5%8B%95%E7%8D%B2%E5%8F%96ua%E9%80%9A%E9%81%8E%E7%8D%B2%E5%8F%96web%E6%8E%A7%E5%88%B6%E8%87%BA%E5%A6%82%E4%BD%95%E7%8D%B2%E5%8F%96-ua

EDAriR commented 1 year ago

問題大致同上

image

sn

10363 all # Fate/stay night [Unlimited Blade Works]
31339 all # OVERLORD 第四季

config

{
    "bangumi_dir": "",
    "temp_dir": "",
    "classify_bangumi": true,
    "check_frequency": 0,
    "download_resolution": "1080",
    "lock_resolution": true,
    "default_download_mode": "latest",
    "use_copyfile_method": false,
    "multi-thread": 0,
    "multi_upload": 3,
    "segment_download_mode": false,
    "multi_downloading_segment": 0,
    "segment_max_retry": 8,
    "add_bangumi_name_to_video_filename": true,
    "add_resolution_to_video_filename": true,
    "customized_video_filename_prefix": "",
    "customized_bangumi_name_suffix": "",
    "customized_video_filename_suffix": "",
    "video_filename_extension": "mp4",
    "zerofill": 1,
    "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
    "use_proxy": false,
    "proxy": "socks5://:",
    "upload_to_server": false,
    "ftp": {
        "server": "",
        "port": "",
        "user": "",
        "pwd": "",
        "tls": true,
        "cwd": "",
        "show_error_detail": false,
        "max_retry_num": 15
    },
    "user_command": "shutdown -s -t 60",
    "coolq_notify": false,
    "coolq_settings": {
        "msg_argument_name": "message",
        "message_suffix": "追加的資訊",
        "query": [
            "http://127.0.0.1:5700/send_group_msg?access_token=abc&group_id=12345678",
            "http://127.0.0.1:5700/send_group_msg?access_token=abc&group_id=87654321"
        ]
    },
    "telebot_notify": false,
    "telebot_token": "",
    "faststart_movflags": false,
    "audio_language": false,
    "use_mobile_api": false,
    "danmu": false,
    "check_latest_version": true,
    "read_sn_list_when_checking_update": false,
    "read_config_when_checking_update": true,
    "ads_time": 25,
    "mobile_ads_time": 3,
    "use_dashboard": true,
    "dashboard": {
        "host": "127.0.0.1",
        "port": 5000,
        "SSL": false,
        "BasicAuth": false,
        "username": "admin",
        "password": "admin"
    },
    "save_logs": false,
    "quantity_of_logs": 7,
    "config_version": 17.0,
    "database_version": 2.0,
    "only_use_vip": false,
    "classify_season": false,
    "discord_notify": false,
    "discord_token": "",
    "plex_refresh": false,
    "plex_url": "",
    "plex_token": "",
    "plex_section": "",
    "plex_naming": false,
    "danmu_ban_words": []
}

UA 有同步

Fate/stay night [Unlimited Blade Works] 第一、二下載成功後面就都出現錯誤

2022-10-28 17:11:23 抓取失敗: sn=10363  抓取影片信息時發生未知錯誤: Impossible to call blocking function in the event loop callback
2022-10-28 17:11:23 更新狀態: sn=10363  檢查更新失敗, 跳過等待下次檢查
2022-10-28 17:11:24 ERROR: 該 sn 下真的有動畫?: sn=31339
2022-10-28 17:11:24 抓取失敗: sn=31339  抓取影片信息時發生未知錯誤: 1
2022-10-28 17:11:24 更新狀態: sn=31339  檢查更新失敗, 跳過等待下次檢查

web.log

另外用ctrl + C退出時候常常出現錯誤

File "~/aniGamerPlus/aniGamerPlus.py", line 695, in user_exit
    err_print(0, '你終止了程序!', '\n', status=1, no_sn=True, prefix='\n\n')
  File "~/aniGamerPlus/ColorPrint.py", line 81, in err_print
    succeed_or_failed_print()
  File "~/aniGamerPlus/ColorPrint.py", line 51, in succeed_or_failed_print
    check_tty = subprocess.Popen('tty', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "~/miniconda3/lib/python3.9/site-packages/gevent/subprocess.py", line 773, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "~/miniconda3/lib/python3.9/site-packages/gevent/subprocess.py", line 1731, in _execute_child
    data = errpipe_read.read()
  File "~/miniconda3/lib/python3.9/site-packages/gevent/_fileobjectposix.py", line 164, in readall
    data = self.__read(DEFAULT_BUFFER_SIZE)
  File "~/miniconda3/lib/python3.9/site-packages/gevent/_fileobjectposix.py", line 158, in __read
    wait_on_watcher(self._read_watcher, None, None, self.hub)
  File "src/gevent/_hub_primitives.py", line 326, in gevent._gevent_c_hub_primitives.wait_on_watcher
  File "src/gevent/_hub_primitives.py", line 350, in gevent._gevent_c_hub_primitives.wait_on_watcher
  File "src/gevent/_hub_primitives.py", line 304, in gevent._gevent_c_hub_primitives._primitive_wait
  File "src/gevent/_hub_primitives.py", line 46, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.wait
  File "src/gevent/_hub_primitives.py", line 46, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.wait
  File "src/gevent/_hub_primitives.py", line 55, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.wait
  File "src/gevent/_waiter.py", line 151, in gevent._gevent_c_waiter.Waiter.get
  File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 64, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 67, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch_out
  File "src/gevent/_greenlet_primitives.py", line 68, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch_out
gevent.exceptions.BlockingSwitchOutError: Impossible to call blocking function in the event loop callback
gn556188 commented 1 year ago

你用瀏覽器看下動畫瘋能不能打開,然後改下UA

改UA可以看這個的說明:https://github.com/miyouzi/aniGamerPlus#%E6%8E%A8%E8%96%A6%E8%87%AA%E5%8B%95%E7%8D% B2%E5%8F%96ua%E9%80%9A%E9%81%8E%E7%8D%B2%E5%8F%96web%E6%8E%A7%E5%88%B6%E8%87%BA% E5%A6%82%E4%BD%95%E7%8D%B2%E5%8F%96-ua

用瀏覽器觀看是正常的

有試過用訪客下載 或是 cookie登入會員下載 換瀏覽器google換成Edge 都有更新過UA

目前試下來都是無解的

zfuchen commented 1 year ago

同樣有問題+1 應該是巴哈有動手腳讓__get_title() 失效

我長時間都是用linux的VPS直接下command line抓 抓完rclone到gsuite 到昨天都還有成功抓下鏈鋸人

今天想下路人超能100就失敗了

zfuchen commented 1 year ago

貼出今天的log

2022-10-28 18:31:12 檢查更新 檢查更新成功 2022-10-28 18:31:12 使用命令行模式, 文件將保存在配置文件中指定的目錄下: /home/Anime 2022-10-28 18:31:12 讀取cookie 發現cookie檔案 2022-10-28 18:31:12 讀取cookie 已讀取cookie 2022-10-28 18:31:12 解析模式: sn=31676 Web解析 2022-10-28 18:31:12 收到新cookie: sn=31676 2022-10-28 18:31:12 用戶cookie刷新 __cf_bm : sn=31676
2022-10-28 18:31:14 ERROR: 該 sn 下真的有動畫?: sn=31676
2022-10-28 18:31:14 抓取失敗: sn=31676 抓取影片信息時發生未知錯誤: 1 2022-10-28 18:31:14 抓取異常: sn=31676 異常詳情: Traceback (most recent call last): File "/home/aniGamerPlus/Anime.py", line 137, in __get_title self._title = soup.find('div', 'anime_name').h1.string # 提取标题(含有集数) AttributeError: 'NoneType' object has no attribute 'h1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/aniGamerPlus/aniGamerPlus.py", line 55, in build_anime anime['anime'] = Anime(sn) File "/home/aniGamerPlus/Anime.py", line 67, in init self.__get_title() # 提取页面标题 File "/home/aniGamerPlus/Anime.py", line 142, in __get_title sys.exit(1) SystemExit: 1

CopanLee commented 1 year ago

同樣問題+1 使用瀏覽器已登入狀態或無痕未登入狀態皆正常 巴哈可能修改了機器人偵測 __get_src的時候會觸發檢查使用者的瀏覽器 類似cloudflare的bot detection 可以暫時使用use_mobile_api解決 附上被阻擋時的頁面html源碼 response.zip

cgg520449 commented 1 year ago

同樣問題+1 今天突然不能下載了,可能要等作者更新軟體了

testabcc commented 1 year ago

同样是这个错误 下载不了已经一天多了

asd01234 commented 1 year ago

同樣問題+1 今天使用的时候出现了相同的问题 我有用代理

kirbyloco commented 1 year ago

@testabcc @asd01234 這是動畫瘋網頁更新導致無法過機器人驗證, 有急用可以把Config裡的use_mobile_api打開。

gn556188 commented 1 year ago

看不懂怎麼更改

只能等大大更新程式了

miyouzi commented 1 year ago

看不懂怎麼更改

只能等大大更新程式了

Web控制台有按钮的。

image

gn556188 commented 1 year ago

未命名

開啟後 跑出這個 還有廣告不是需要30秒嗎

感覺看30秒廣告後 就能正常了?

我付費帳號到期了 沒辦法測付費的

miyouzi commented 1 year ago

未命名

開啟後 跑出這個 還有廣告不是需要30秒嗎

config.json 文件中的 "mobile_ads_time":3 改成 "mobile_ads_time":30 (修改APP解析广告等待时间为30秒)

gn556188 commented 1 year ago

未命名

變成ffmpeg抓不到了 我整個砍掉重抓 也一樣

asd01234 commented 1 year ago

@miyouzi CMWY8 4_0H }M(J9Z9U@CJE F%ND}CZ~T}DWLZ_{TBMMIJ 模擬手機端解析开不了

miyouzi commented 1 year ago

未命名

變成ffmpeg抓不到了 我整個砍掉重抓 也一樣

ffmpeg.exe 放在和 aniGamerPlus.exe 同一个资料夹下,而不是放在 ffmpeg 资料夹里面

miyouzi commented 1 year ago

@miyouzi CMWY8 4_0H }M(J9Z9U@CJE F%ND}CZ~T}DWLZ_{TBMMIJ 模擬手機端解析开不了

@asd01234 检查 config.json 文件的 "use_mobile_api": true"mobile_ads_time":30 是否正确配置

gn556188 commented 1 year ago

非常感謝 已可以正常下載

ffmpeg太久沒下載了 抓錯檔案了 查了一下 改裝ffmpeg.exe 就正常了

asd01234 commented 1 year ago

@miyouzi 谢谢,现在能正常下載了

asd01234 commented 1 year ago

@miyouzi 期待软件更新,最好添加防止账号被封的功能那就太好了,嘿嘿

cgg520449 commented 1 year ago

感謝~~ 現在用手機模擬的方式 可以下載。 把 config.json 文件中的 "mobile_ads_time":3 改成 "mobile_ads_time":30 就可以搞定了。

cgg520449 commented 1 year ago

@miyouzi 期待软件更新,最好添加防止账号被封的功能那就太好了,嘿嘿

這很難,應該是一次量抓太大,尤其是一次下載2X~3X集,如果每天抓個幾集,是不會影響的。 我的本帳號被封了,不能再看巴哈的動畫,但是論壇不影響。

題外話,如果你有登入會員,會發現你的巴哈的觀看紀錄,自己1分鐘內狂看 N部以上,

zfuchen commented 1 year ago

剛測試把 config.json裡面設定成 "use_mobile_api": true "mobile_ads_time": 30 就可以正常下載了

BraveSail commented 1 year ago

暂时发现只有 https://ani.gamer.com.tw/animeVideo.php 开了验证,https://ani.gamer.com.tw 没事

a3510377 commented 1 year ago

確實不過還翻不到他驗證的方法 :L 繼續研究 :<

miyouzi commented 1 year ago

初步判斷使用的 CloudFlare 反爬,帶有 SSL/TLS client fingerprints 認證,正在嘗試解決(可能會挺久的)

kirbyloco commented 1 year ago

Python目前不能改ja3相關的東西, 只能透過其他軟體(改過的curl或用Go、NodeJS)去幫忙處理才行, 或者重新編譯一個Python(帶改過的OpenSSL)也是可行的,但太複雜。

@miyouzi 好奇您打算用哪種方法處理??

BraveSail commented 1 year ago

初步判斷使用的 CloudFlare 反爬,帶有 SSL/TLS client fingerprints 認證,正在嘗試解決(可能會挺久的)

试试python3.10+? 隔壁yt-dlp最近也有类似问题 https://github.com/yt-dlp/yt-dlp/pull/5294#issuecomment-1289679325 https://github.com/yt-dlp/yt-dlp/pull/5294#issuecomment-1292356600

miyouzi commented 1 year ago

Python目前不能改ja3相關的東西, 只能透過其他軟體(改過的curl或用Go、NodeJS)去幫忙處理才行, 或者重新編譯一個Python(帶改過的OpenSSL)也是可行的,但太複雜。

@miyouzi 好奇您打算用哪種方法處理??

目前有兩種想法

一種是像 ffmpeg 一樣,把 curl-impersonate 作為本專案的外部依賴程式去調用。

一種是自行編譯魔改的 pycurl ,編譯好后發佈到 pypi,實現可以通過 pip 安裝

kirbyloco commented 1 year ago

试试python3.10+? 隔壁yt-dlp最近也有类似问题 yt-dlp/yt-dlp#5294 (comment) yt-dlp/yt-dlp#5294 (comment)

確實可以解決,但requests和httpx沒法用這個方法處理。

BraveSail commented 1 year ago

確實可以解決,但requests和httpx沒法用這個方法處理。

什么都不用改,直接升级到python3.10不行吗

kirbyloco commented 1 year ago

什么都不用改,直接升级到python3.10不行吗

直接升3.10是不行的。

miyouzi commented 1 year ago

稍後可嘗試下 v24.3

1106639911 commented 1 year ago

[ ]

#

1106639911 commented 1 year ago

2022-11-07 16:21:52 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: unable to connect ani.gamer.com.tw:443 2022-11-07 16:23:20 Dashboard 通過 Web 控制臺下達了手動任務 當前下載模式: 僅下載本集

2022-11-07 16:23:42 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: unable to connect ani.gamer.com.tw:443 用的24.3

miyouzi commented 1 year ago

2022-11-07 16:21:52 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: unable to connect ani.gamer.com.tw:443 2022-11-07 16:23:20 Dashboard 通過 Web 控制臺下達了手動任務 當前下載模式: 僅下載本集

2022-11-07 16:23:42 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: unable to connect ani.gamer.com.tw:443 用的24.3

因为使用了新的组件,该组件不支持系统代理,请在配置文件配置代理 (或者使用带有Tap之类的虚拟网卡的代理软件)

1106639911 commented 1 year ago

在http://127.0.0.1:5000/网页里面这个http://127.0.0.1:1780应该怎么样配置代理

1106639911 commented 1 year ago

我用的就是Clash 带有TAP虚拟网卡的代理软件但是就是提示抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: unable to connect ani.gamer.com.tw:443 用的24.3

MoeACG-Xyrh commented 1 year ago

我用的就是Clash 带有TAP虚拟网卡的代理软件但是就是提示抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: unable to connect ani.gamer.com.tw:443 用的24.3

image 把端口改成1780就行了

1106639911 commented 1 year ago

port改成1780吗?改了还是不行 當前下載模式: 僅下載本集

2022-11-07 17:06:18 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: 'no_proxy_akamai' 2022-11-07 17:06:25 Dashboard 通過 Web 控制臺下達了手動任務 當前下載模式: 僅下載本集

2022-11-07 17:06:25 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: 'no_proxy_akamai'

MoeACG-Xyrh commented 1 year ago

port改成1780吗?改了还是不行 當前下載模式: 僅下載本集

2022-11-07 17:06:18 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: 'no_proxy_akamai' 2022-11-07 17:06:25 Dashboard 通過 Web 控制臺下達了手動任務 當前下載模式: 僅下載本集

2022-11-07 17:06:25 抓取失敗: sn=20273 抓取影片信息時發生未知錯誤: 'no_proxy_akamai'

你clash端口是1780?还有,代理开关开了吗,再一个把协议改成http试试

1106639911 commented 1 year ago

是的我的clash端口是1780代理开关开了还是不行

MoeACG-Xyrh commented 1 year ago

是的我的clash端口是1780代理开关开了还是不行

你截图我看看

1106639911 commented 1 year ago

这里上传不了图片怎么上传我不会

MoeACG-Xyrh commented 1 year ago

截图到剪切板直接文字框粘贴就行

1106639911 commented 1 year ago

提示我这个 Something went really wrong, and we can’t process that file.

1106639911 commented 1 year ago

------------------ 原始邮件 ------------------ 发件人: "miyouzi/aniGamerPlus" @.>; 发送时间: 2022年11月7日(星期一) 下午5:14 @.>; @.**@.>; 主题: Re: [miyouzi/aniGamerPlus] 抓取sn失敗 ERROR (Issue #215)

截图到剪切板直接文字框粘贴就行

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

asd01234 commented 1 year ago

3JAYR~NR%6J(QAGAEL0CEDM CU$6)@KN@EAL@U)~PE7T3JK RH QY@6)W$OAGC)81MOD9{0 我今天都能下载

BraveSail commented 1 year ago

你 config.json 没更新吧? 看看有没有 no_proxy_akamai 选项