Kethsar / ytarchive

Garbage Youtube livestream downloader
MIT License
1.15k stars 93 forks source link

Record sub only stream #58

Closed BiRooT closed 1 year ago

BiRooT commented 2 years ago

Hello,

I tried to record sub only stream without success. With /live url, it works for normal stream, but when streamer launch sub only stream, script return: "Error retrieving player response: unable to retrieve player response object from watch page" Like streamer did'nt launch a stream. I'm sub to this streamer and I use cookie.

Can you add option to check /community page ?

Thanks.

Kethsar commented 2 years ago

Can you tell me the exact command you used and the version of ytarchive you are using?

BiRooT commented 2 years ago
root@ks:/var/www/stream/ytarchive$ ./ytarchive --version
ytarchive 0.3.0

screen -d -m -S ytarchive bash -c 'while true; do /var/www/stream/ytarchive/ytarchive --cookies /var/www/stream/ytarchive/cookies.txt --debug --merge --mkv --output '/var/www/stream/ytarchive/Ryu7z.`(date +%F_%H:%M)`' --no-wait https://www.youtube.com/channel/UCTI0uTrhBxjRiUDdJJIhmGw/live best; sleep 30; done'

I use a loop to don't have to restart once a first stream is retrieved.

Kethsar commented 2 years ago

Thanks. I'll try to figure this out. Might be harder since I don't have membership to anyone, so if a member stream is happening, /live doesn't take me there. On that note, can I ask you verify the website does take you to a member stream when using /live if you haven't checked already? I assume it does but I just want to be certain.

BiRooT commented 2 years ago

Ok I will wait a futur member stream to check where /live redirect me.

Lytexx commented 2 years ago

Can confirm that it doesn't, It takes you to the channel page or whatever public stream is currently scheduled

Kethsar commented 2 years ago

@Lytexx doesn't redirect or /live for member streams in ytarchive does not work? Edit: okay thanks. @BiRooT I might look into a way around this but for the time being I guess /live cannot actually be used for member streams. A shame, but you can blame Youtube's weird functionality for that.

CanOfSocks commented 2 years ago

Can confirm member streams don't come up with /live. I've been using this with yt-dlp and ytarchive specifically for member streams until a more efficient way can be implemented.

This is using bash:

while true
do
  id=$(yt-dlp --skip-download --wait-for-video 60-1800 --cookies "cookies.txt" --print id --playlist-end 1 https://www.youtube.com/channel/[channel ID]/membership) #Checks for the first video in the playlist and grabs the ID. If it's a livestream it waits until live do yt-dlp can print the ID. The --match-filter "is_live" stops it sending a VOD video ID to ytarchive
  if ! test -z "$id"; then #If there is a video found, the ID is sent to ytarchive to download
    ytarchive "/vidTemp/[%(upload_date)s] %(title)s - %(channel)s [%(id)s]" -w -r 60 --merge -t --threads 5 --no-frag-files --cookies "cookies.txt" --add-metadata https://www.youtube.com/watch?v=$id best
  fi
  sleep 60
done

It's not pretty but this works for me