glubsy/livestream_saver

"The following content is not available on this app." errors

glubsy opened this issue ยท 8 comments

glubsy commented

Recently these errors, along with 403 forbidden errors, started appearing more and more, sometimes at random during download.

Have to find a way to handle these. Sending up to date client version in POST requests might not be quite enough.

Other mentions of this: iv-org/invidious#3230 TeamNewPipe/NewPipe#8713

1268 commented

If it helps, I did some research on this here:

https://github.com/4cq2/mech/blob/v1.3.8/youtube/params.md

not sure if its exactly the same issue, but might be helpful.

Is there any update on this issue? I left running livestream_saver on my remote machine for a while and only today I realized that nothing was being actually saved.

I'm getting this error:

  • CRITICAL - download.-Th9Fq7pYl4 - Missing streamingData key in json!
    2023-05-11 18:02:09,111 - WARNING - download.-Th9Fq7pYl4 - Error acessing title from player_response: 'videoDetails'
    2023-05-11 18:02:09,111 - WARNING - download.-Th9Fq7pYl4 - Error fetching description from player_response: 'videoDetails'
    2023-05-11 18:02:09,111 - WARNING - download.-Th9Fq7pYl4 - Error fetching description from player_response: 'videoDetails'
    2023-05-11 18:02:09,111 - WARNING - download.-Th9Fq7pYl4 - An output directory already existed. We assume a failed download attempt. Last segment available was 1.
    2023-05-11 18:02:09,111 - INFO - download.-Th9Fq7pYl4 - Will start downloading from segment number 0.
    2023-05-11 18:02:09,176 - INFO - download.-Th9Fq7pYl4 - Stream seems to be viewed live. Good.
    2023-05-11 18:02:09,176 - WARNING - download.-Th9Fq7pYl4 - Livestream -Th9Fq7pYl4 playability status is: ERROR Reason: This video is unavailable. Sub-reason: Watch on the latest version of YouTube.. Error reason: The following content is not available on this app..
    2023-05-11 18:02:09,176 - WARNING - download.-Th9Fq7pYl4 - Outdated client error. Retrying shortly...
    2023-05-11 18:02:09,177 - INFO - livestream_saver.util - Sleeping for 5.36 minutes (321.54 seconds)...
1268 commented

if it helps, I am using request like this now:

POST /youtubei/v1/player HTTP/1.1
Host: www.youtube.com
User-Agent: com.google.android.youtube/18.20.99

{
 "context": {
  "client": {
   "androidSdkVersion": 99,
   "clientName": "ANDROID",
   "clientVersion": "18.20.99"
  }
 },
 "videoId": "-Th9Fq7pYl4"
}

if it helps, I am using request like this now:

POST /youtubei/v1/player HTTP/1.1
Host: www.youtube.com
User-Agent: com.google.android.youtube/18.20.99

{
 "context": {
  "client": {
   "androidSdkVersion": 99,
   "clientName": "ANDROID",
   "clientVersion": "18.20.99"
  }
 },
 "videoId": "-Th9Fq7pYl4"
}

Where should I edit this request?

Is there a specific file?

glubsy commented

@4cq2 thanks for chiming in and sharing your knowledge, I'm keeping an eye on your findings.
That updated client version seems to work. Will be using it for the time being, thanks.

@hbbernardo you can try the latest commit, but be warned that you will still get HTTP Error 403: Forbidden when trying to download segments.
I am still investigating potential solutions but I might end up using yt-dlp to download streams if I stay stuck for too long (I have already started importing their codebase for client selection).

If you are in a hurry, I suggest using yt-dlp instead (you could have it loop on a channel with the following command for example:

while true; do yt-dlp --fragment-retries 50 -o '%(upload_date)s [%(uploader)s] %(title)s [%(height)s][%(id)s].%(ext)s' -ciw -f '133+140/134+140/mp4+m4a/bestvideo+bestaudio' --add-metadata --embed-thumbnail  --live-from-start --match-filter 'is_live' https://www.youtube.com/chanel_name_or_id/live; sleep $((5*60)); done

Edit: as of 2023/07/20, the /live tab does not return the current livestream consistently.

1268 commented

if someone can detail an example video thats failing I can look into it. Generally I am not interested in live videos, so I cant promise I will be interested to help if thats the case.

glubsy commented

@4cq2 all live videos fail to download right now. But don't worry about it, especially if you're not interested in live videos. There are other tools out there like yt-dlp that still work. It's probably just a matter of computing the cipher signature properly.

1268 commented

ah OK if it only impacts live video, then I will let someone else handle the issue. if any non-live videos are impacted, I am happy to help