miyouzi / aniGamerPlus

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

抓取影片信息時發生未知錯誤: 'latin-1' codec can't encode character '\u20ac' #220

Closed paul0665 closed 1 year ago

paul0665 commented 1 year ago

問題描述

抓取失敗: sn=31622 抓取影片信息時發生未知錯誤: 'latin-1' codec can't encode character '\u20ac' in position 642: ordinal not in range(256)

錯誤截圖

![SSA](https://user-images.githubusercontent.com/47947919/200742873-458e9738-77b5-4b01-b324-3f7eeac5a3c8.png)

config.json

```json { "bangumi_dir": "H:\\Video", "temp_dir": "Y:\\tempVideo", "classify_bangumi": true, "check_frequency": 4320, "download_resolution": "1080", "lock_resolution": false, "default_download_mode": "all", "use_copyfile_method": false, "multi-thread": 1, "multi_upload": 3, "segment_download_mode": true, "multi_downloading_segment": 1, "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": "hind", "use_proxy": false, "proxy": "https://user:0000@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": 30, "mobile_ads_time": 30, "use_dashboard": false, "dashboard": { "host": "127.0.0.1", "port": 65535, "SSL": true, "BasicAuth": false, "username": "admin", "password": "admin" }, "save_logs": true, "quantity_of_logs": 7, "config_version": 17.2, "database_version": 2.0, "telebot_notify": false, "telebot_token": "", "only_use_vip": true, "discord_notify": true, "discord_token": "hind", "plex_refresh": false, "plex_url": "", "plex_token": "", "plex_section": "", "danmu_ban_words": [], "classify_season": false, "plex_naming": false, "no_proxy_akamai": false, "download_cd": 1260, "parse_sn_cd": 47 } ```

sn_list

```txt 31622 ```

log

```txt 檢查更新 檢查更新成功 自動模式啓動aniGamerPlus 當前aniGamerPlus版本: v24.5 工作目錄: G:\aniGamerPlus24.5 開始更新 讀取cookie 發現cookie檔案 讀取cookie 已讀取cookie 解析模式: sn=31622 Web解析 收到新cookie: sn=31622 用戶cookie刷新 : sn=31622 抓取失敗: sn=31622 抓取影片信息時發生未知錯誤: 'latin-1' codec can't encode character '\u20ac' in position 642: ordinal not in range(256) 抓取異常: sn=31622 異常詳情: Traceback (most recent call last): File "aniGamerPlus.py", line 55, in build_anime File "Anime.py", line 73, in __init__ File "Anime.py", line 141, in __get_src File "Anime.py", line 361, in __request File "Anime.py", line 288, in __request File "requests\sessions.py", line 600, in get File "requests\sessions.py", line 587, in request File "requests\sessions.py", line 701, in send File "requests\adapters.py", line 489, in send File "urllib3\connectionpool.py", line 703, in urlopen File "urllib3\connectionpool.py", line 398, in _make_request File "urllib3\connection.py", line 239, in request File "http\client.py", line 1252, in request File "http\client.py", line 1293, in _send_request File "urllib3\connection.py", line 224, in putheader File "http\client.py", line 1225, in putheader UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' in position 642: ordinal not in range(256) 更新狀態: sn=31622 檢查更新失敗, 跳過等待下次檢查 更新資訊 本次更新添加了 0 個新任務, 目前列隊中共有 0 個任務 更新终了 ```
miyouzi commented 1 year ago

檢查cookie是不是有非英文字符

paul0665 commented 1 year ago

檢查cookie是不是有非英文字符

對比了一下後發現是複製cookie的時候不能直接框選.必須使用"複製值"選項去複製, 否則出來的數值會包含亂碼 螢幕擷取畫面 (2)