hakkin / twitchpipe Goto Github PK
View Code? Open in Web Editor NEWPipe your favorite Twitch streams to the media player of your choice, or a file to save them for later. Supports low-latency playback.
License: MIT License
Pipe your favorite Twitch streams to the media player of your choice, or a file to save them for later. Supports low-latency playback.
License: MIT License
TLDR :
Implement a versioning system for the binary to provide users with version information using a -v option.
Description
Currently, the binary lacks a method for users to easily identify its version. Implementing a versioning feature will enhance user experience by allowing them to quickly verify the version of the binary they are using. This is particularly useful for debugging, support, and ensuring compatibility with other software.
Proposed Solution
Add a -v or --version option to the binary command line interface.
I have a list of streamers that I am wanting to monitor but one of them is banned and it is unknown when they would be back but I wanted to keep the script going until that happens. I added the username (forsen
in this case) and it causes the script to stop after the error message ERROR! could not get ID for "forsen"
. Is it possible to skip ones that it cannot find and continue with the ones it does? Or maybe for the missing IDs it can't find, add them to a scheduled lookup taken every x minutes to see if it changed?
The current playlist selection is fairly basic, just matching the playlist group names, with a special "best" case that will select source quality if available, otherwise the highest bitrate playlist.
A more ideal playlist selection would be similar to the format selection youtube-dl provides, where you can filter by stream metadata (we already have this data available in code, we're just not using it), and allow fallback formats if the preferred one is not available.
Fallback playlists would be particularly useful for record.sh
, since it can be difficult to guarantee a playlist group will exist across multiple streamers (besides source quality), in which case you could just specify something like 720p60/720p30/best
, or [height=720]/best
.
Hi, as of 2022-11-10(?), twitchpipe recordings contain intermission screens. One "preparing your stream..." screen at the beginning (15s), and "commercial break in progress" screens during ads.
For some recordings, the "commercial break in progress" screen does not appear, the vod will simply jump to next segment. The result is the start of a broadcast is missing, and seeking during playback is pretty broken.
I assume this is due to embed streams getting an 'updated experience'
https://discuss.dev.twitch.tv/t/an-updated-twitch-embedded-player-viewer-experience/41718
streamlink/streamlink#4934 (comment)
It's understandable if there's little interest in continuing given Twitch's goal of self-destruction. Regardless, gratitude is long overdue for a project that has worked flawlessly for this length of time. Thank you
Could it be possible to log chat through the record tool?
https://github.com/lay295/TwitchDownloader is the best chat logger that I could find. It saves the metadata of badges/emotes/users so everything can be included, but also it has a renderer too. The only thing is that it's C# and doesn't have support for CLI/Linux. Here's an example of what the chat looks like after it's rendered https://twitcharchives.com/video/38643000464
Right now in certain cases twitchpipe can write truncated TS packets, most media players handle this fine, but not all. Reading/Writing in 188 byte chunks should probably be enough to ensure we're writing on TS packet boundaries, this could be further ensured by checking for packet sync bytes.
Is there a way to record a live stream (preferably with record.sh) using a video quality different from the source? Currently the script records the highest quality possible but I'd like to choose 720p60 instead of the source(1080p) for example. Is that possible?
When using record.sh instead of downloading the whole stream from start to finish it would be neat to be able to choose to download in parts by stream time. For example, when archiving twitch vods to Youtube, the vod can't be over 12 hours long as such when using record.sh if the stream is longer than 12 hours you need to trim it, divide it into two or more parts of 12 hours or less using ffmpeg or video editing software which can take time.
when i try on some streams like the username (morebilal) i've got the error of the title why ?
the script doesn't work currently (can't get the user_id) because twitch is being twitch. The work around is instead of using "Client-ID: xxxxxxxxxxx"
use "Authorization: OAuth xxxxxxxxxxx"
and it'll spill out he user_id like it should.
get_id () {
curl --silent --fail -H "Authorization: OAuth xxxxxxxxxxxxxx" "$API_URL$1" | jq -r ._id
}
Basically title
Is it possible for twitchpipe to grab metadata from stream and write a log file in the same naming format as the recording? like date-uniqueid.ts
and date-uniqueid.txt
?
I think the twitch API gives quite a bit of info on a stream when it's live like stream start date/time (this could be useful for archiving and possible chat sync), game changes (if it could log all possible game categories that were set and the time they were set at in the recording/localtime), title changes (most times a streamer forgets to change their title before going live and would change it many times during stream, it'd be nice for archival purposes), and maybe peak viewers (archival purposes).
I think the API supports all of these.
Could there be a secondary check done on startup using the API to see if a streamer is live and record the live ones? I worry that whenever a system restart is needed or processes need to be restarted, it could miss out on several users' streams for the day.
video is fine, anyone having the same issue ?
Twitch might be making more changes to their ad injection, breaking compatibility even further. I ran a test of a few streamers yesterday and it gave back a few errors in the process.
Maybe it has to do with the extra functions I added master...camjac251:master
[maya] skipping segment: couldn't copy ts to output: read: context deadline exceeded (Client.Timeout or context cancellation while reading body)
[maya] skipping segment: got non-2xx http status 404 Not Found
[maya] stream over
[pokelawls] stream started
[pokelawls] recording to /mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_07_33_24_UTC.ts
[pokelawls] skipping segment: couldn't copy ts to output: read: context deadline exceeded (Client.Timeout or context cancellation while reading body)
[pokelawls] skipping segment: got non-2xx http status 404 Not Found
[pokelawls] skipping segment: got non-2xx http status 404 Not Found
[pokelawls] skipping segment: couldn't copy ts to output: read: context deadline exceeded (Client.Timeout or context cancellation while reading body)
[pokelawls] skipping segment: got non-2xx http status 404 Not Found
[pokelawls] stream over
/mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_07_33_24_UTC.ts
remuxing /mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_07_33_24_UTC.ts to /mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_07_33_24_UTC.mp4
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.94753024","message":"{\"type\":\"viewcount\",\"server_time\":1608804480.298666,\"viewers\":5901}"}}
deleting /mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_07_33_24_UTC.ts
[pokelawls] stream started
[pokelawls] recording to /mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_10_08_50_UTC.ts
[pokelawls] could not extract playlist: stream is offline
[pokelawls] output file /mnt/twitch/streams/pokelawls/pokelawls-2020_12_24_10_08_50_UTC.ts was empty, removing...
There is also a jq error that happened a few times but is likely unrelated
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.94753024","message":"{\"type\":\"viewcount\",\"server_time\":1608786691.129787,\"viewers\":5335}"}}
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.96858382","message":"{\"type\":\"viewcount\",\"server_time\":1608786691.129787,\"viewers\":2303}"}}
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.38746172","message":"{\"type\":\"viewcount\",\"server_time\":1608786691.129787,\"viewers\":16067}"}}
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.96858382","message":"{\"type\":\"viewcount\",\"server_time\":1608786721.245259,\"viewers\":2326}"}}
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.94753024","message":"{\"type\":\"viewcount\",\"server_time\":1608786721.245259,\"viewers\":5477}"}}
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.247808909","message":"{\"type\":\"viewcount\",\"server_time\":1608787981.529022,\"viewers\":1502}"}}
jq: error (at <stdin>:1): Cannot index string with string "type"
parse error: Expected string key before ':' at line 1, column 7
>"type":"MESSAGE","data":{"topic":"video-playback-by-id.94753024","message":"{\"type\":\"viewcount\",\"server_time\":1608789451.299460,\"viewers\":8093}"}}
Title. I managed to fix it in the past but I got a new computer and I don't remember what I did. Google isn't helping either
Is it possible ?
All twitch usernames are lowercase alpha-numeric, but Twitch's APIs are case sensitive, so we should force usernames to lowercase before sending them.
Currently if i try to record the stream but it is offline i get the following: 'could not extract playlist: stream is offline' what about adding an option for the application to wait till the stream go live (checks every minute for exemple) and then proceed. thanks for the wonderful tool btw
Currently if the token expires twitchpipe will get stuck in a loop of 403 errors, we should reacquire a fresh token if we see a 403.
I'm very intrigued by the readme's description of the archive function. All of the "archiving" scripts out there for live twitch streams work with the API and a schedule/cron system for checking whether or not someone goes live, then starts the recording from that point with streamlink
/youtube-dl
. I'm using https://github.com/jrudess/streamdvr which uses a schedule system but with the way it operates, up to 60 seconds of the beginning could be cut off (with a 60 second cron schedule).
Could this script do something similar for multiple streamers? streamdvr records to username_site_YYYYmmdd_timestarted.ts using streamlink then uses ffmpeg to fix the aac bitstream afterward and conforms it to an .mp4 from capturing/TWITCH/streamer/username_site_YYYYmmdd_timestarted.ts
to captured/TWITCH/streamer/username_site_YYYYmmdd_timestarted.ts
. This works as a daemon and works on all of the added streamers to config.
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.