Python vlc错误:无法启动播放机:vlc.exe(进程过早退出)
`进口期货 导入时间 随机输入 导入操作系统Python vlc错误:无法启动播放机:vlc.exe(进程过早退出),python,proxy,bots,Python,Proxy,Bots,`进口期货 导入时间 随机输入 导入操作系统 # desired channel url channel_url = 'https://www.twitch.tv/nickname' # number of viewer bots botcount = 1 # path to proxies.txt file proxypath = "./proxy.txt" # path to vlc playerpath = r'./vlc.exe' # takes proxies f
# desired channel url
channel_url = 'https://www.twitch.tv/nickname'
# number of viewer bots
botcount = 1
# path to proxies.txt file
proxypath = "./proxy.txt"
# path to vlc
playerpath = r'./vlc.exe'
# takes proxies from proxies.txt and returns to list
def create_proxy_list(proxyfile, shared_list):
with open(proxyfile, 'r') as file:
proxies = [line.strip() for line in file]
for i in proxies:
shared_list.append(i)
return shared_list
# takes random proxies from the proxies list and adds them to another list
def randproxy(proxylist, botcount):
randomproxylist = list()
for _ in range(botcount):
proxy = random.choice(proxylist)
randomproxylist.append(proxy)
proxylist.remove(proxy)
return randomproxylist
# launches a viewer bot after a short delay
def launchbots(proxy):
print(proxy)
time.sleep(random.randint(5, 20))
client_id = f"client-id="
url = f"streamlink --player={playerpath} --player-no-close --player-http --hls-segment-timeout 30 --hls-segment-attempts 3 --retry-open 1 --retry-streams 1 --retry-max 1 --http-stream-timeout 3600 --http-header {client_id} {channel_url} audio_only"
os.system(url)
# calls the launchbots function asynchronously
def main(randomproxylist):
with concurrent.futures.ThreadPoolExecutor() as executer:
executer.map(launchbots, randomproxylist)
if __name__ == "__main__":
main(randproxy(create_proxy_list(proxypath, shared_list=list()), botcount))`
我对这段代码有一个很大的问题,因为我对它是绿色的,我对这个脚本的工作有一个很大的问题,我只是不想连接到这个url