raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.3k stars 2.98k forks source link

[YouTube Downloader] Handle Youtube Playlist links #11365

Closed chrismessina closed 6 months ago

chrismessina commented 6 months ago

Extension

https://www.raycast.com/vimtor/youtube-downloader

Description

It's not clear if the issue is because the video is from a recent livestream or that the link itself contains a reference to a playlist, but the YouTube Downloader can't seem to process it successfully.

This is the error I got:

TypeError: Expected a finite number, got number: NaN

GO:index.tsx:20:41

---
17: import fs from "fs";
18: 
19: export default function DownloadVideo() {
20:   const [loading, setLoading] = useState(false);
21:   const [title, setTitle] = useState("");
22:   const [formats, setFormats] = useState<videoFormat[]>([]);
23:   const [error, setError] = useState(0);
---

Or:index.js:11:2490
    at ray-navigation-stack
Ro:index.js:11:2088

Steps To Reproduce

  1. Activate YouTube Downloader in Raycast and attempt to download this link
  2. An error will be produced:

2024-03-18 (15 27 10) Arc

The content of the error:

TypeError: Expected a finite number, got number: NaN

GO:index.tsx:20:41

---
17: import fs from "fs";
18: 
19: export default function DownloadVideo() {
20:   const [loading, setLoading] = useState(false);
21:   const [title, setTitle] = useState("");
22:   const [formats, setFormats] = useState<videoFormat[]>([]);
23:   const [error, setError] = useState(0);
---

Or:index.js:11:2490
    at ray-navigation-stack
Ro:index.js:11:2088

Current Behaviour

YouTube Downloader is unable to download this video.

Expected Behaviour

YouTube Downloader should be able to handle playlists; it could:

raycastbot commented 6 months ago

Thank you for opening this issue!

🔔 @vimtor @pernielsentikaer @darmiel you might want to have a look.

💡 Author and Contributors commands The author and contributors of `vimtor/youtube-downloader` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopen the issue.
chrismessina commented 6 months ago

Looking more deeply at this, it may be because:

  1. The livestream was still happening. It seemed to also be available here.
  2. The file hadn't finished processing.

In any case — better error handling would be useful for live events and playlists!

vimtor commented 6 months ago

Hey @chrismessina!

You are 100% right we could add better error handling for these two cases.

I will implement it in the next batch of updates for the extension.