ArthurFDLR / whisper-youtube

🔉 Youtube Videos Transcription with OpenAI's Whisper
https://colab.research.google.com/github/ArthurFDLR/whisper-youtube/blob/main/whisper_youtube.ipynb
MIT License
352 stars 105 forks source link

KeyError: 'streamingData' #8

Closed lambone closed 1 year ago

lambone commented 1 year ago

I run the notebook directly in Colab, here is the error

Youtube video : https://youtu.be/R_GPAl_q2QQ

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
[<ipython-input-14-75bd6ee34080>](https://localhost:8080/#) in <cell line: 18>()
     38             raise(RuntimeError(f"{URL} isn't available."))
     39         video_path_local = Path(".").resolve() / (video_yt.video_id+".mp4")
---> 40         video_yt.streams.filter(
     41             type="audio",
     42             mime_type="audio/mp4",

2 frames
[/usr/local/lib/python3.9/dist-packages/pytube/__main__.py](https://localhost:8080/#) in streams(self)
    294         """
    295         self.check_availability()
--> 296         return StreamQuery(self.fmt_streams)
    297 
    298     @property

[/usr/local/lib/python3.9/dist-packages/pytube/__main__.py](https://localhost:8080/#) in fmt_streams(self)
    174         self._fmt_streams = []
    175 
--> 176         stream_manifest = extract.apply_descrambler(self.streaming_data)
    177 
    178         # If the cached js doesn't work, try fetching a new js file

[/usr/local/lib/python3.9/dist-packages/pytube/__main__.py](https://localhost:8080/#) in streaming_data(self)
    159         else:
    160             self.bypass_age_gate()
--> 161             return self.vid_info['streamingData']
    162 
    163     @property

KeyError: 'streamingData'

Thanks

ArthurFDLR commented 1 year ago

The issue is coming from an external dependency: https://github.com/pytube/pytube/issues/1542. If the issue isn't resolved soon, I'll update the Notebook to use yt-dlp instead of pytube.

htkolab commented 1 year ago

(maybe another issue ?) I have never been able to get a video from googe drive to work. I tried different formats, but even mp4 and wav never worked on my end. No error message. I tried to run "Rune the model" but it runs for 3 seconds and stops, but it used to work with a url

htkolab commented 1 year ago

The issue is coming from an external dependency: pytube/pytube#1542. If the issue isn't resolved soon, I'll update the Notebook to use yt-dlp instead of pytube.

Good idea yt-dlp, I was going to suggest it

ArthurFDLR commented 1 year ago

(maybe another issue ?) I have never been able to get a video from googe drive to work. I tried different formats, but even mp4 and wav never worked on my end. No error message. I tried to run "Rune the model" but it runs for 3 seconds and stops, but it used to work with a url

I just tried an MP4 and a WAV file, and both work as expected. The path to provide should take root in your GDrive space, not the machine on which the Notebook is deployed. Let's say you have a folder videos in your Google Drive with a video my_video.mp4. video_path should be set to videos/my_video.mp4. Hope it helps, I'd need more details to solve the issue otherwise.

ArthurFDLR commented 1 year ago

73657997044bad9c4222f5094ee66509efd8e0e9 Removed the pytube dependency in favor of yt-dlp