thedrhax / twitch-utils Goto Github PK
View Code? Open in Web Editor NEWRecord, concatenate and synchronize Twitch live streams and remove background music
License: GNU General Public License v3.0
Record, concatenate and synchronize Twitch live streams and remove background music
License: GNU General Public License v3.0
Sometime channels disable clips. I thought it would be interesting while you record a stream, to have a command to make a clip.
Also, a bug if stream is live and I start recording, but that there's no VOD, program won't start recording.
โ ~ twitch_utils record --oauth=add_oauth pommed0r12345 -j 2
Traceback (most recent call last):
File "/usr/local/bin/twitch_utils", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/twitch_utils/__init__.py", line 29, in main
record_main(argv)
File "/usr/local/lib/python3.7/dist-packages/twitch_utils/record.py", line 292, in main
v = api.find_vod(channel)
File "/usr/local/lib/python3.7/dist-packages/twitch_utils/twitch.py", line 46, in find_vod
return stream['archiveVideo']['id']
TypeError: 'NoneType' object is not subscriptable
Instead of using Twitch's OAuth token, we can create our own. It would be enough for detecting stream and live VOD, but streamlink would still require first-party token, that can be configured separately.
C:\Users\Administrator\Desktop\New folder (6)>twitch_utils record dodgeballcanada -j 2 -b 2M
Checking if channel dodgeballcanada
is active...
Stream is online! Found the ID of live VOD: 534927868
Starting to record the live stream...
Downloading https://twitch.tv/dodgeballcanada
into 534927868.end.ts
Process Process-1:
Traceback (most recent call last):
File "e:\users\administrator\appdata\local\programs\python\python36\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "e:\users\administrator\appdata\local\programs\python\python36\lib\multiprocessing\process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "e:\users\administrator\appdata\local\programs\python\python36\lib\site-packages\twitch_utils\record.py", line 57, in download
sl_proc = Popen(sl_cmd, **sl_kwargs)
File "e:\users\administrator\appdata\local\programs\python\python36\lib\subprocess.py", line 729, in init
restore_signals, start_new_session)
File "e:\users\administrator\appdata\local\programs\python\python36\lib\subprocess.py", line 991, in _execute_child
args = list2cmdline(args)
File "e:\users\administrator\appdata\local\programs\python\python36\lib\subprocess.py", line 481, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'NoneType' is not iterable
In previous version bandwidth limiting was provided using the pv
utility that is not available on many Linux distributions by default. We need a pure Python solution.
User should be able to choose output container for concatenated stream. It is already implemented in concat
, so we just need to pass output file name to it.
It is possible to run concat
on start.ts
and end.ts
while end.ts
is still being downloaded. Concat should successfully build a complete timeline of the stream. An error would mean that start.ts
is too short and should be downloaded again.
Some dependencies such as praat-parselmouth
or spleeter
are heavy, and are only required by one script from the whole package. Users must be able to install this package partially by using extras_require from setuptools.
Package name | Dependencies |
---|---|
tdh-twitch-utils | requests, python-dateutil, docopt |
tdh-twitch-utils[record] | streamlink |
tdh-twitch-utils[offset] | praat-parselmouth |
tdh-twitch-utils[mute] | tensorflow, spleeter |
tdh-twitch-utils[all] | all of the above |
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.