ancalentari / twitch-stream-recorder Goto Github PK
View Code? Open in Web Editor NEWRecord twitch streams live!
License: MIT License
Record twitch streams live!
License: MIT License
Made a similar twitch-recorder if anyone wants to use it: https://github.com/Avnsx/twitch-stream
This repo is unmaintained and also introducing the usage of twitch API as shown in this repo is kinda bothersome, so mine is way easier to set up and use. Just trying to help! :)
This script works on my laptop, but my laptop is prone to shutting down randomly throughout the day. After installing it on my desktop computer yesterday, I consistently run into this error upon running the script:
PS C:\Users\DBH> py twitch-recorder.py -u a_seagull
checking for a_seagull every 15 seconds, recording with best quality
a_seagull online, stream recording in session
Traceback (most recent call last):
File "twitch-recorder.py", line 199, in
main(sys.argv[1:])
File "twitch-recorder.py", line 195, in main
twitch_recorder.run()
File "twitch-recorder.py", line 82, in run
self.loop_check(recorded_path, processed_path)
File "twitch-recorder.py", line 152, in loop_check
subprocess.call(
File "C:\Program Files\Python38\lib\subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Program Files\Python38\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
PS C:\Users\DBH
Even if the stream is at 1080p the best quality avaialbe by the script is max 720p60.
Can someone help with this ?
self.quality = "best"
log after "python twitch-recorder.py"
Traceback (most recent call last):
File "twitch-recorder.py", line 199, in <module>
main(sys.argv[1:])
File "twitch-recorder.py", line 167, in main
twitch_recorder = TwitchRecorder()
File "twitch-recorder.py", line 42, in __init__
self.access_token = self.fetch_access_token()
File "twitch-recorder.py", line 46, in fetch_access_token
token_response.raise_for_status()
File "C:\Users\dmitr\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://id.twitch.tv/oauth2/token?client_id=jzkbprff40iqj646a697cyrvl0zt2m6&client_secret=hi1moptnyhyd0h4sxmhtsx7gy905vr&grant_type=client_credentials
I'm running twitch-recorder.py as a background job to archive streams. Unfortunately, I've been having a lot of issues lately with the output being truncated, resulting in a broken MP4 file. I've been able to recover the files using https://github.com/anthwlock/untrunc but I still end up losing part of the stream - sometimes a significant part of it.
Unfortunately, the script doesn't log the output of streamlink or ffmpeg, so it's hard to know what's causing these errors.
It would be nice to have the subprocess output captured and included in the log file, at least at debug level.
Whenever i try to record a stream it says this
usage: streamlink [OPTIONS] [STREAM]
streamlink: error: unrecognized arguments: --twitch-oauth-token best
recording stream is done, processing video file
skip fixing, file not found
processing is done, going back to checking...
I just tried to record a livestream what worked very well. The file was written with "Written 232.2 MB (5m10s @ 739.7 KB/s)".
i noticed followin by playing the file with VLC:
My Setup:
[cli][info] Found matching plugin twitch for URL twitch.tv/gronkh
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[download][..oy - FREiAB18 ff6.mp4] Written 368.1 MB (8m8s @ 738.5 KB/s)
Tried to fix with:
ffmpeg -err_detect ignore_err -i video.mkv -c copy video_fixed.mkv
this only fixed the lengh of the file and not the sound problem
Do anyone have an idea? I searched for hours and found nothing helpfull
Hi, I've been using this thing about a half year now, and I noticed that
'when the stream starts, it begins with 720p, and then goes up to 1080p.'
It feels really bad when I finds my files were downloaded in 720p.
Even if I put the refresh rate on 5 minutes, there are some unlucky (or should I say I was extremely lucky that refresh timing and the beginning of streaming was on the exact time) moments.
So I'm wondering If there's anyway not to start downloading when the best output is 720p, make the program waits for a few moments, and then download when 1080p is available?
Thanks for your help in advance! I totally love this! It saves my live as an editor several times.
Hi, this is mosty a thanks for the new recorder script. :)
possibly add being able to disable ffmpeg conversion, never had a problem playing the recorded stream and if the stream dies i want to start recording again as quickly as possible not wait until ffmpeg finishes. misnamed ffmpeg for now.
thanks again.
i don't really know what happened here. first i thought that there was a stream with the exact same name but this should not be possible since there is a timestamp too and it should keep the names unique. all i know is that there was an unexpected confirmation prompt that i didn't know about for many days. would appreciate it a lot if this could be fixed somehow by maybe using another name automatically if the file exist instead of stopping the whole thing at an prompt that requires manual input
Changelog of streamlink 2.0.0:
Argument --twitch-ouath-token used here:
twitch-stream-recorder/twitch-recorder.py
Line 153 in fd74d8e
Causes a fatal error π The solution would be to just remove the argument altogether. I don't know what purpose it served in the first place
Good morning, First of all thank you for this excellent work. I wonder if it is possible to add a functionality to record in small files for example 10 minutes, instead of saving the transmission in a single file?
regards
Hey i have the problem that sometimes the download of a stream randomly stops.
i dont get any error messages and my internet connection is stable aswell. filesize isnt a problem either. got 120gb+ free on every drive
Cause of this i have to check every now and then if the download is still running and if i dont see any update in file size or time in the console i close the window and start again.
But then the download wether stops again after a couble of seconds or it works. its a hit and miss.
what could possibly be the issue. Tell me if you need more information :)
Greetings alvy
its possible to subscribe to stream changes per User. If a user comes online we could autorecord that
Is it possible to allow this to record multiple streams at once?
Is there a way to stop the current recoding and save the video?
If I close terminal or simply stop the script the recordings are lost.
Thanks
I have been using twitch-stream-recorder for many months, it is great software, thank you for making it!
During that time I leave it running and am accustomed to seeing the message:
<twitch-user> currently offline, checking again in 15 seconds
and this will keep checking every 15 seconds until the comes online and then the software will record the stream.
However, recently I have noticed that after the intial "checking in 15 seconds" message as above, the twitch-stream-recorder software now gives the message:
<time-of-day> unexpected error. will try again in 5 minutes
For example:
python3.8 twitch-recorder.py --username francoisknyc --quality audio_only checking for francoisknyc every 15 seconds, recording with audio_only quality francoisknyc currently offline, checking again in 15 seconds 04h20m44s unexpected error. will try again in 5 minutes
I have recently built a new VM Ubuntu 20.04.03, with a fresh download of twitch-stream-recorder, to see if the issue would re-occur and it does.
This is the output of twitch-recorder.log:
INFO:root:checking for francoisknyc every 15 seconds, recording with audio_only quality
INFO:root:francoisknyc currently offline, checking again in 15 seconds
ERROR:root:04h20m44s unexpected error. will try again in 5 minutes
INFO:root:checking for francoisknyc every 15 seconds, recording with audio_only quality
ERROR:root:04h25m35s unexpected error. will try again in 5 minutes
Could you please offer assistance as to a fix on this?
Thank you.
Haven't been able to figure out how to disable ads for twitch, the channel I'm subbed to is the same channel I'm trying to record. Any help would be appreciated. I'm doing this on ubuntu version 22.04
Windows 10 1903
Streamlink 1.7.0
Elevated command prompt
Hi, there is a strong chance I am doing this incorrectly, but please help me understand:
I have created the config.py file in the same directory as twitch-recorder.py on my D: drive. I have filled the information as per the readme, and I have installed python and the request module. I have navigated to the directory in the command prompt.
However, when I run the command python twitch-recorder.py
I receive the following error:
Traceback (most recent call last):
File "twitch-recorder.py", line 13, in <module>
import config
ModuleNotFoundError: No module named 'config'
I have triple checked the readme on both github and in the file, and I feel as if I have followed the instructions to a tee. Any help would be massively appreciated.
I was able to get this script working a day or two ago. I tested it and it worked splendidly.
Today I went to run the script and I am consistently receiving the following errors.
checking for <streamername> every 15 seconds, recording with best quality
<streamername> online, stream recording in session
Traceback (most recent call last):
File "D:\twitch-recorder.py", line 199, in <module>
main(sys.argv[1:])
File "D:\twitch-recorder.py", line 195, in main
twitch_recorder.run()
File "D:\twitch-recorder.py", line 82, in run
self.loop_check(recorded_path, processed_path)
File "D:\twitch-recorder.py", line 152, in loop_check
subprocess.call(
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\USERj\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Any help would be massively appreciated.
This maybe out of scope for this project, but is it possible to record from other sites? For example, I want to record NASASpaceflight on YouTube, but their URL changes every time they start a new stream.
Is there a way to filter record-actions by the category?
As example: I just like to record 'just chatting' streams
07h46m59s unexpected error. will try again in 5 minutes
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.