現在,我開始一個Python項目,該項目應該對選定的twitch頻道進行截圖,修改這些截圖並將其放在GUI上。圖形用戶界面不應該是一個問題,但我的屏幕截圖有問題。
我發現了2個資源來處理twitch通信:python-twitch包和一個名爲ttvsnap的腳本(https://github.com/chfoo/ttvsnap)。
這個軟件包對我沒有任何幫助,因爲我沒有找到任何與屏幕截圖相關的東西。該腳本看起來很有前途,但是我遇到了一些問題:使用Python從Twitch抓取屏幕截圖
根據創建者的說法,ttvsnap會定期截取一個抽搐流並將它們放入選定的目錄中。
如果我嘗試啓動腳本,我得到這個錯誤:從劇本
Traceback (most recent call last):
File "ttvsnap.py", line 13, in <module>
import requests
ImportError: No module named 'requests'
擦除「導入請求」讓我來運行它,但隨後的腳本與選擇問題目錄。要運行腳本,我應該寫:
Python ttvsnap.py 'streamname here' 'directory here'
從創作者的例子目錄是「./screenshot/」,但與投入,我發現了以下錯誤(也許是因爲我」 M於Windows)中:
Output directory specified is not valid.
試圖像C目錄:\ DevFiles \截圖給我下面的錯誤:
Invalid drive specification. ###Translated this line since I'm using a German OS
Traceback (most recent call last):
File "ttvsnap.py", line 176, in <module>
main()
File "ttvsnap.py", line 46, in main
subprocess.check_call(['convert', '-version'])
File "C:\Program Files (x86)\Python35-32\lib\subprocess.py", line 584, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['convert', '-version']' returned non-zero exit status 4
如何得到它運行任何想法或不同的資源使用將非常感激。
你有沒有試過'PIP安裝requests'?它不是標準庫的一部分。 – jonrsharpe