offish / twitchtube Goto Github PK
View Code? Open in Web Editor NEWTwitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.
License: MIT License
Twitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.
License: MIT License
When trying to upload youtube video....
Plese resolve this issue.
Hey, so i'm pulling 1 clip at a time rather than a compilation, i'm rendering these with my video outro and the file name shows as rendered. When uploading to youtube it always just names it as asdasda, if there any way to make it pull the name of the clip automatically?
Thanks!
The clips downloaded fine but it does not upload to youtube even with the firefox profile
Traceback (most recent call last):
File "C:\Users\Zendek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.752.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.752.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Zendek\Desktop\twitchtube-master\main.py", line 55, in
upload = Upload(ROOT_PROFILE_PATH, SLEEP, HEADLESS, DEBUG)
File "C:\Users\Zendek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\opplast\upload.py", line 22, in init
self.driver = webdriver.Firefox(firefox_profile=profile, options=options)
File "C:\Users\Zendek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in init
self.service.start()
File "C:\Users\Zendek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
Hello! Tell me how to check for duplicate clips?
Traceback (most recent call last):
File "/data/data/com.termux/files/home/twitch/main.py", line 50, in
upload_video_to_youtube(config)
File "/data/data/com.termux/files/home/twitch/twitchtube/upload.py", line 206, in upload_video_to_youtube
os.makedirs(f'{PATH}/credentials')
File "/data/data/com.termux/files/usr/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/data/data/com.termux/files/home/twitch/credentials'
I have downloaded twitchtube some time ago and i started getting errors when uploading the video to youtube, so i came here to see if i messed up the code and the upload file is gone.
Python 3.0 (r30:67507, Dec 3 2008, 19:44:23) [MSC v.1500 64 bit (AMD64)] on win32
IDLE 3.0 ==== No Subprocess ====
>>>
Traceback (most recent call last):
File "twitchtube-master\example.py", line 1, in <module>
from twitchtube.video import make_video
File "\twitchtube\video.py", line 83
f"You're running an old version of {project}, installed: {version}, current: {current}"
^
SyntaxError: invalid syntax
>>>
i constantly have to rerun the script to get it to work
Would it be possible to configure to upload on youtube automatically after a new clip is generated on the twitch without repeating the clip?
On YouTube Brazil there is a channel called "Lucas Motta Clips" that posts a new clip every 20 minutes. Currently, it has 7,130 videos uploaded in approximately 8 months. (Probably a bot)
I want to test the limit of daily uploads from YouTube in order to exceed the number of videos uploaded.
Please add UTF-8 encoding to Twitch Clip Title if it is non-English.
twitchtube | 07:09:26 - info: Downloading clip with slug: UglyVibrantCrabsCharlietheUnicorn.
Traceback (most recent call last):
File "main.py", line 43, in <module>
names = download_clips(clips, VIDEO_LENGTH, path)
File "/home/kyroskoh/twitchtube/twitchtube/clips.py", line 144, in download_clips
download_clip(data[clip]['url'], path)
File "/home/kyroskoh/twitchtube/twitchtube/clips.py", line 91, in download_clip
log.info(f'Saving "{clip_title}" as "{out_filename}".')
File "/home/kyroskoh/twitchtube/twitchtube/logging.py", line 21, in info
log(f.GREEN, 'info', text)
File "/home/kyroskoh/twitchtube/twitchtube/logging.py", line 15, in log
print(f'{f.GREEN}twitchtube {f.WHITE}| {time} - {color + sort}{f.WHITE}: {text}{f.WHITE}')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 58-59: ordinal not in range(256)
I downloaded all from requirements.txt. when i run main.py, i get error. How fix this?
twitchtube | 15:55:50 - info: Starting to make a video for Team Fortress 2 Traceback (most recent call last): File "C:\twitchtube-master2\main.py", line 29, in <module> names = download_clips(clips, VIDEO_LENGTH, path) File "C:\twitchtube-master2\dist\clips.py", line 97, in download_clips download_clip(data[clip]["url"], path) File "C:\twitchtube-master2\dist\clips.py", line 36, in download_clip mp4_url, clip_title = get_clip_data(slug) File "C:\twitchtube-master2\dist\clips.py", line 14, in get_clip_data thumb_url = clip_info['data'][0]['thumbnail_url'] KeyError: 'data'
raise VideoPathAlreadyExists("specify another path")
twitchtube.exceptions.VideoPathAlreadyExists: specify another path
Due to new changes in opplast, twitchtube will crash when trying to upload to YouTube.
Is there anyway in the current Twitchtube release to only use Top clips from the channels you specified or does this already do this and do I have bad settings/too small channels.
The clips downloaded fine but it errored out finding elements by xpath, how do we just retry that part to upload to youtube?
I want to use this for global offensive counter strike, still can't use it? I could make a video tutorial to use the software. Thank you.
In version 1.5.1, when the title was not defined in Main.py, uploading to YouTube used the slug to get the name of the downloaded clip. Can I still do this and have not found or been removed?
it only grabs 5 clips each time i try to run it, and it isn't meeting the time that i want it to be.
Can this be made, so you get the clips from a user, instead of an entire game category?
Hello, I want to do a 3 hours video but I can't.
I did some tests and I guess it's impossible to do a longer video than around 50 minutes with this params :
VIDEO_LENGTH = 60
More than 60 doesn't work.
Hello,
Just after the video is done recording ("twitchtube | 11:26:13 - info: Video is done rendering!") I have this error poping in my command prompt:
`Traceback (most recent call last):
File "C:\Users\Narvalo V2\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\Narvalo V2\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Narvalo V2\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The specified file is not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\BOT Twitch\V2\twitchtube-master\main.py", line 76, in
make_video(**parameters)
File "D:\BOT Twitch\V2\twitchtube-master\twitchtube\video.py", line 173, in make_video
upload = Upload(profile_path, sleep, headless, debug)
File "C:\Users\Narvalo V2\AppData\Local\Programs\Python\Python39\lib\site-packages\opplast\upload.py", line 24, in init
self.driver = webdriver.Firefox(firefox_profile=profile, options=options)
File "C:\Users\Narvalo V2\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in init
self.service.start()
File "C:\Users\Narvalo V2\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.`
It stops the program before uploading on Youtube and I can't find the solution. Do you have any idea?
Hi, i love your python app 👍
I was thinking that it would be a great addition to do like the game mode but for the channel mode 👍 and maybe the name of the streamers in simple text at the start of any clip 👍
Error message to any request to twitch when trying to start the bot:
The v5 API is deprecated and will be shutdown on February 28, 2022. Applications that have not accessed v5 before July 15, 2021 no longer have access to v5. For more information on the v5 API shutdown plan, see https://blog.twitch.tv/2021/07/15/legacy-twitch-api-v5-shutdown-details-and-timeline/ and the Twitch API documentation at https://dev.twitch.tv/docs/api.
how we can modify it so that it add all the clips of the day and not just the top clips, thank you
Timestamps:
00:20 - Trainwrecks wins big on slots
01:12 - xQc bukbukbuk
Clips:
https://clips.twitch.tv/Something
https://clips.twitch.tv/SomethingAgain
How can I avoid clips that don't have anything attractive?
Many people clip nonsense, a clip where nothing much happens. Is there any way to prevent this?
It downloads all of the clips and then renders into 1 video but the rendered video has no sound (the clips have sound)
Is it possible to add a condition to get only clips with X views?
Hello,
It seems to me to have configured everything well but when the "Wrinting video (directory)/rendered.mp4 bar reaches 70% of loading my computer freezes. I have no errors at the time of the freeze.
Do you have any idea where this might come from?
Thanks
DEBUG: Found YouTube upload Dialog Modal
DEBUG: Trying to set "dead 2mw then OMEGALULS" as title...
twitchtube | 15:22:23 - error: There was an error Message: Element <div id="textbox" class="style-scope ytcp-mention-textbox"> is not clickable at point (484,291) because another element <img id="illustration" class="style-scope ytcp-warm-welcome-dialog" src="https://www.gstatic.com/youtube/img/creator/user_onboarding/warm_welcome_illustration_default_v3_darkmode.svg"> obscures it
when trying to upload to YouTube
DEBUG: Closed Firefox
twitchtube | 15:22:25 - info: Getting files to delete...
it didnt upload , and then it deleted all of the clips without uploading the render
After running the python main.py command I get this error.
Traceback (most recent call last):
File "C:\Users*\Downloads\youtube\twitchtube-master\main.py", line 8, in
from twitchtube.config import *
File "C:\Users*\Downloads\youtube\twitchtube-master\twitchtube\config.py", line 15
ROOT_PROFILE_PATH = "C:\Users****\AppData\Roaming\Mozilla\Firefox\Profiles\5q8sjx41.Selenium2"
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Hi ! I tried to upload a video today but there is this error :
twitchtube | 19:36:09 - error: There was an error Message: Unable to locate element: /html/body/ytcp-uploads-dialog/paper-dialog/div/ytcp-animatable[1]/ytcp-uploads-details/div/ytcp-uploads-basics/ytcp-mention-textbox[2]
when trying to upload to YouTube
Am I the only one who can't upload recently with twitchtube?
Maybe there was an update of Youtube upload page ? Idk, I will fork and check what's wrong.
I dont know why, but for some reason when i start script i only get these errors.
twitchtube | 09:16:58 - info: You're running the latest version of twitchtube at 1.6.5 twitchtube | 09:16:58 - info: You're running the latest version of opplast at 1.0.7 twitchtube | 09:16:58 - info: Going to make video featuring 1 streamers/games, that will end up being ~330.0 seconds long twitchtube | 09:16:59 - info: Getting clips for game League of Legends twitchtube | 09:16:59 - clip: Downloading clip with slug: FaithfulOnerousLadiesHotPokket-8Ertpoet8m5S7-xb. twitchtube | 09:16:59 - clip: Saving 'FaithfulOnerousLadiesHotPokket-8Ertpoet8m5S7-xb' as 'FaithfulOnerousLadiesHotPokket8Ertpoet8m5S7xb.mp4'. Traceback (most recent call last): File "C:\Users\Nikola\Downloads\twitchtube-1.6.5\twitchtube-1.6.5\main.py", line 80, in <module> make_video(**parameters) File "C:\Users\Nikola\Downloads\twitchtube-1.6.5\twitchtube-1.6.5\twitchtube\video.py", line 147, in make_video names += download_clips(batch, path, oauth_token, client_id) File "C:\Users\Nikola\Downloads\twitchtube-1.6.5\twitchtube-1.6.5\twitchtube\clips.py", line 187, in download_clips download_clip(data[clip]["url"], path, oauth_token, client_id) File "C:\Users\Nikola\Downloads\twitchtube-1.6.5\twitchtube-1.6.5\twitchtube\clips.py", line 81, in download_clip urllib.request.urlretrieve(mp4_url, output_path, reporthook=get_progress) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 239, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 214, in urlopen return opener.open(url, data, timeout) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 517, in open response = self._open(req, data) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain result = func(*args) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 1389, in https_open return self.do_open(http.client.HTTPSConnection, req, File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 1315, in do_open h = http_class(host, timeout=req.timeout, **http_conn_args) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1396, in __init__ context = ssl._create_default_https_context() File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 750, in create_default_context context.load_default_certs(purpose) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 574, in load_default_certs self._load_windows_store_certs(storename, purpose) File "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 566, in _load_windows_store_certs self.load_verify_locations(cadata=certs) ssl.SSLError: [ASN1] nested asn1 error (_ssl.c:4174)
The problem is quite simple.
No matter if the script generated a video in the last 24 hours, but it seems to only work one time.
Also, on the config you can check the time the script check if a video have been made but the 1 hour message is hard coded.
So it not show the currently time set in the config.
Basically it works only one day.
I wasnt able to let the script generate 2 clips from 2 differents days.
Hi, just updated to the new version and i'm getting this error when i want to make a new video, here is the error
C:\Users\MyUser\Desktop\twitchtube> python main.py "c mychannel, c friend1channel, c friend2channel, c friend3channel, c friend4channel" --duration 10.5 --resolution 1080 1920
twitchtube | 17:45:27 - info: Running twitchtube at v1.6.0
twitchtube | 17:45:27 - info: Starting to make video with 5 streamers/games
Traceback (most recent call last):
File "C:\Users\User\Desktop\twitchtube\main.py", line 82, in <module>
make_video(**parameters)
File "C:\Users\User\Desktop\twitchtube\twitchtube\video.py", line 91, in make_video
new_clips, new_ids = get_clips(
File "C:\Users\User\Desktop\twitchtube\twitchtube\clips.py", line 128, in get_clips
raise WrongKrakenResponse(f"Could not find 'clips' in response. {response}")
twitchtube.exceptions.WrongKrakenResponse: Could not find 'clips' in response. {'clips': [], '_cursor': ''}
In next update can you add youtube video titles numbering feature n
For example gaming video 1 gaming video 2...3...4...n
also to get latest twitch clips instead of most view clips
I did not understand how the Thumbnails work?
Installed everything and I get this error for running the config.py for the first time
Im sorry if this is a super dumb question but I really dont understand how to get an OAuth token. When I try to use the site you mention (https://twitchapps.com/tokengen/). It wants my Client-ID and something for "scopes". I just dont know what to type in there. The other problem is that I dont know what to fill the client_secret.json with for the most part.
https://prnt.sc/tnf1pp
https://prnt.sc/tnf1v4
Add a section to provide a Thumbnail?
It could be a good enhancement to ban a channel from a 'game' mode video.
I wonder it's possible to add the name of the streamer directly at the top of the video in addition to the credits in the discription
Rather than a compilation video I've been uploading single clips, but for example when I upload one of XQC's clips it just pulls the same one and uploads it over and over again, is there a way to only download (or upload) clips that I haven't already used?
Thanks!
~/twitch $ python main.py
Traceback (most recent call last):
File "/data/data/com.termux/files/home/twitch/main.py", line 9, in
from twitchtube.config import *
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 786, in exec_module
File "", line 922, in get_code
File "", line 979, in get_data
PermissionError: [Errno 13] Permission denied: '/data/data/com.termux/files/home/twitch/twitchtube/config.py'
~/twitch $
Hey!
I know that it's not the issue with the script but I would appreciate if you could help me with that 🙂
What do I do wrong? Is there any other way to obtain OAth token?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.