Tyrrrz / YoutubeExplode

Abstraction layer over YouTube's internal API
MIT License
2.96k stars 496 forks source link

Cannot retrieve HLS manifest for live streams #566

Closed Tyrrrz closed 3 years ago

Tyrrrz commented 3 years ago

Version

6.0.2, 6.0.3

Details

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:52.11]     User can get HTTP live stream URL from a video [FAIL]
Error: User can get HTTP live stream URL from a video: YoutubeExplode.Exceptions.YoutubeExplodeException : Could not extract HTTP Live Stream manifest URL. Video '5qap5aO4i9A' is likely not a live stream.
  Failed User can get HTTP live stream URL from a video [388 ms]
  Error Message:
   YoutubeExplode.Exceptions.YoutubeExplodeException : Could not extract HTTP Live Stream manifest URL. Video '5qap5aO4i9A' is likely not a live stream.
  Stack Trace:
     at YoutubeExplode.Videos.Streams.StreamClient.GetHttpLiveStreamUrlAsync(VideoId videoId, CancellationToken cancellationToken) in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode\Videos\Streams\StreamClient.cs:line 344
   at YoutubeExplode.Tests.StreamsSpecs.User_can_get_HTTP_live_stream_URL_from_a_video() in D:\a\YoutubeExplode\YoutubeExplode\YoutubeExplode.Tests\StreamsSpecs.cs:line 231
--- End of stack trace from previous location ---

Steps to reproduce

Run test: User can get HTTP live stream URL from a video

TaoziDB commented 3 years ago

for live streams, such as https://www.youtube.com/watch?v={videoId} in html data using newest browser user-agent: between "var ytInitialPlayerResponse = " and ";var meta =", you can get json string of player response, and "hlsManifestUrl" is the master m3u8 url of all resolutions

vikashhd commented 3 years ago

GetHttpLiveStreamUrlAsync returning error 404

Hexer10 commented 3 years ago

Seems like the hls manifest url is present in the WatchPage's player response. In my dart port I managed to make this working by using the watchpage and its player response.

Tyrrrz commented 3 years ago

Seems like the hls manifest url is present in the WatchPage's player response. In my dart port I managed to make this working by using the watchpage and its player response.

Thanks!

Joseph-Nathan commented 3 years ago

any exp code please , i do not found player response in scraping .