看板 Python 關於我們 聯絡資訊
以下程式碼都是在google colab上運行 之前都用得好好的,我也沒有改程式碼,但最近突然出現 " get_throttling_function_name: could not find match for multiple" 我查了一下好像是正規表達式的問題,查到的資料是只要在cipher.py這個文件中把 其中一個";"刪掉就好了,只是我跑一下程式碼: """ !pip uninstall pytube -y !pip install git+https://github.com/pytube/pytube !pip install pydub !apt-get install ffmpeg import os import pytube # 修復 cipher.py 文件 cipher_path = os.path.join(os.path.dirname(pytube.__file__), 'cipher.py') # 確認 cipher_path 是否正確 print(f"Cipher file path: {cipher_path}") with open(cipher_path, 'r') as file: filedata = file.readlines() # 確認文件內容 print("Original cipher.py content:") print("".join(filedata[280:290])) # 查看原始文件的特定部分 # 修改第 287 行的程式碼 filedata[287] = " r'var {nfunc}\\s*=\\s*(\\[.+?\\])'.format(\n" # 確認修改後的文件內容 print("Modified cipher.py content:") print("".join(filedata[280:290])) # 寫回文件 with open(cipher_path, 'w') as file: file.writelines(filedata) print("cipher.py 修復完成") """ 結果出現第287行還是沒有改掉,到底是出了甚麼問題? 以下是cipher.py原始代碼,謝謝 https://reurl.cc/dnEKd2 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 117.56.22.197 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1721002443.A.CC7.html
surick: 抱歉忘了說查到的資料是說刪掉287行的; 07/15 08:14
DaOppaiLoli: pytube 滿常這樣的,看要不要換 yt-dlp 之類的 07/16 12:39