Git Product home page Git Product logo

twitch-stream-recorder's Issues

FileNotFoundError: [WinError 2] The system cannot find the file specified

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

Best Quality Availabe 720p

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"

==============================
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p60 (best)
[cli][info] Opening stream: 720p60 (hls)
[plugins.twitch][info] Will skip ad segments

fail start

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

streamlink/ffmpeg output is not logged

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.

Unrecognized arguments

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...

Sound Shutter/lag in recorded File

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:

  • On the beginning of each record I have an 15 secon ad (this is fine for me)
  • after closing the record or stream ending, i checked the files an every record on every stream has a shuttering sound
  • I also noticed: the voice is much deeper then in real life or on livestream.
  • also tried with ffmpg disabled

My Setup:

  • Win 10
  • Python 3.9
  • streamlink
  • ffmpg
  • Recording to SSD
  • 0% Usage of SSD while recording
  • 20% Usage of CPU while recording
[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

  1. I don't know why the bitrate is so low, I have a 1Gbps Download.
  2. Why do the sound shutter/lag

Do anyone have an idea? I searched for hours and found nothing helpfull

Is there anyway to avoid 720p, but only start download when it's 1080p?

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.

Script ideas.

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.

possible data loss from unexpected confirmation prompt

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
prompt

Record the transmission in 10 minute files

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

Download stops every now and then

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

Stop and save current recording.

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

new "unexpected error" message

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.

Disable Advertisements

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

ModuleNotFoundError: No module named 'config'

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.

Script No Longer Working

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.

Recorder for other sites

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.

Filter Stream Category

Is there a way to filter record-actions by the category?

As example: I just like to record 'just chatting' streams

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.