Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching formats failed #28

Open
Rafee-M opened this issue Jan 30, 2022 · 12 comments
Open

Fetching formats failed #28

Rafee-M opened this issue Jan 30, 2022 · 12 comments

Comments

@Rafee-M
Copy link

Rafee-M commented Jan 30, 2022

When pressing Ctrl + f gives out an error

image

@benyaminl
Copy link

benyaminl commented Feb 1, 2022

I also experience the same. does this only works on linux?

I think this problem raise because we users use ytdlp, and at line 196-210 on .lua script is really depends on the youtube-dl, lead to broken downloading format. hmm.. Let me try to see if changing to yt-dlp.exe works

EDIT: Yes it works if we replace youtube-dl to yt-dlp on line 164.

Is there anyway to bind this config to .conf file?

@jgreco ? as Youtube-dl already abandoned by the author itself.. and spin off as yt-dlp?
Prove :
lua script
image
the GUI result
image

@Rafee-M
Copy link
Author

Rafee-M commented Feb 1, 2022

@benyaminl I've changed it and I still get the same error

@benyaminl
Copy link

benyaminl commented Feb 1, 2022 via email

@Rafee-M
Copy link
Author

Rafee-M commented Feb 1, 2022

Moving it from the mpv's install directory to ~\AppData\Roaming\mpv\scripts solved the issue, along with changing youtube-dl to yt-dlp on line 164. Thanks!

@Rafee-M Rafee-M closed this as completed Feb 1, 2022
@benyaminl
Copy link

@RafeeDaBoy I think yt-dlp path should be tested on cmd first, because I've yt-dlp and mpv on same folder and I put it on env path, then it works. Please remember that when you change env path, you need to restart, as lua/python can't detect automatically

I think this issue should kept open as we need to adopt it as conf.

ping @jgreco

@Rafee-M
Copy link
Author

Rafee-M commented Feb 2, 2022

Yes, I had checked if yt-dlp and mpv was working in cmd and it was.

And I've reopened the issue.

@Rafee-M Rafee-M reopened this Feb 2, 2022
@arktnld
Copy link

arktnld commented May 25, 2023

Made this code to fix this error

-- Function to check if a command is executable
function isExecutable(command)
    local f = io.popen("which " .. command)
    local path = f:read("*a")
    f:close()
    return string.len(path) > 0
end

-- Check if youtube-dl or yt-dlp is in PATH
if isExecutable("youtube-dl") then
    yt_tool = "youtube-dl"
elseif isExecutable("yt-dlp") then
    yt_tool = "yt-dlp"
end

local ytdl = {
    path = yt_tool,
    searched = false,
    blacklisted = {}
}

@benyaminl
Copy link

@arktnld I think you need to make a PR, so @jgreco could see it. Hopefully it will be updated. Thanks for the heads up @arktnld

@arktnld
Copy link

arktnld commented Jun 18, 2023

@benyaminl done #32

@subhanshu1111
Copy link

subhanshu1111 commented Jun 26, 2023

Made this code to fix this error

-- Function to check if a command is executable
function isExecutable(command)
    local f = io.popen("which " .. command)
    local path = f:read("*a")
    f:close()
    return string.len(path) > 0
end

-- Check if youtube-dl or yt-dlp is in PATH
if isExecutable("youtube-dl") then
    yt_tool = "youtube-dl"
elseif isExecutable("yt-dlp") then
    yt_tool = "yt-dlp"
end

local ytdl = {
    path = yt_tool,
    searched = false,
    blacklisted = {}
}

where do i add this inside my lua script? at the end of file?
edit: I added your lua script from pull request you made but still doesnt work on macos

@arktnld
Copy link

arktnld commented Jun 29, 2023

edit: I added your lua script from pull request you made but still doesnt work on macos

@subhanshu1111 First, test if these commands are working:

youtube-dl -F {URL}

or

yt-dlp -F {URL}

Sometimes youtube-dl or yt-dlp don't work correctly.

@IlgazC
Copy link

IlgazC commented Aug 30, 2023

I am having this problem on openSUSE TW and I also removed the unmaintained youtube-dl and use yt-dl only which is in /usr/bin

Here is the result of -F
yt-dlp -F https://www.youtube.com/watch?v=P-8C-f1flcw
[youtube] Extracting URL: https://www.youtube.com/watch?v=P-8C-f1flcw
[youtube] P-8C-f1flcw: Downloading webpage
[youtube] P-8C-f1flcw: Downloading ios player API JSON
[youtube] P-8C-f1flcw: Downloading android player API JSON
[youtube] P-8C-f1flcw: Downloading m3u8 information
[youtube] P-8C-f1flcw: Downloading m3u8 information
[youtube] P-8C-f1flcw: Downloading m3u8 information
[info] Available formats for P-8C-f1flcw:
ID EXT RESOLUTION FPS │ TBR PROTO │ VCODEC VBR ACODEC MORE INFO
─────────────────────────────────────────────────────────────────────────────
233 mp4 audio only │ m3u8 │ audio only unknown Default
234 mp4 audio only │ m3u8 │ audio only unknown Default
269 mp4 256x144 15 │ 290k m3u8 │ avc1.42C00B 290k video only
91 mp4 256x144 15 │ 290k m3u8 │ avc1.42c00b mp4a.40.5
229 mp4 426x240 30 │ 546k m3u8 │ avc1.4D4015 546k video only
92 mp4 426x240 30 │ 546k m3u8 │ avc1.4d4015 mp4a.40.5
230 mp4 640x360 30 │ 1210k m3u8 │ avc1.4D401E 1210k video only
93 mp4 640x360 30 │ 1210k m3u8 │ avc1.4d401e mp4a.40.2
231 mp4 854x480 30 │ 1569k m3u8 │ avc1.4D401F 1569k video only
94 mp4 854x480 30 │ 1569k m3u8 │ avc1.4d401f mp4a.40.2
232 mp4 1280x720 30 │ 2969k m3u8 │ avc1.4D401F 2969k video only
95 mp4 1280x720 30 │ 2969k m3u8 │ avc1.4d401f mp4a.40.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants