Jump to content

DownMedia — Download media from popular sources


Recommended Posts

Ok, sorry. Here there are:

 

1) Output:

Updating Homebrew...

==> Updated Casks

epichrome                   protonmail-bridge           sequel-ace                  swish                       toolreleases

Warning: youtube-dl 2020.11.1.1 already installed

 

2) Workflow version: 20.10

3)Alfred version 4.2[1180]

4)Catalina 10.15.7

5) URL tested: https://www.youtube.com/watch?v=t8PcvrovE7k 

5)Debugger:

 

 

[15:56:35.733] DownMedia[Script Filter] Queuing argument ''

[15:56:36.478] DownMedia[Script Filter] Script with argv '' finished

[15:56:36.480] STDERR: DownMedia[Script Filter] /Applications/Alfred.alfredpreferences/workflows/user.workflow.8B093E4E-55DD-4A57-96B2-1773642F9F36/get_title_and_url.js: execution error: Error: Error: You need a supported browser as your frontmost app (-2700)

[15:56:36.480] DownMedia[Script Filter] {"items":[{"uid":"downmedia audio","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"audio","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"audio","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"audio","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"audio","add_to_watchlist":false,"full_playlist":true}}},"title":"https://www.youtube.com/watch?v=t8PcvrovE7k","arg":"https://www.youtube.com/watch?v=t8PcvrovE7k"}]}

[15:56:40.398] DownMedia[Script Filter] Processing complete

[15:56:40.400] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=t8PcvrovE7k' to Run Script

[15:56:43.588] ERROR: DownMedia[Run Script] ERROR: Unable to extract JS player URL; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

[15:56:43.594] DownMedia[Run Script] Processing complete

[15:56:43.594] DownMedia[Run Script] Passing output '' to Run Script

 

 

 

Thank you 🙂

 

 

Link to comment
5 hours ago, Daniele said:

[15:56:43.588] ERROR: DownMedia[Run Script] ERROR: Unable to extract JS player URL; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

 

youtube-dl is failing to grab that download, but the Workflow is working fine. We’ll have to wait for them to fix that (if they can).

Link to comment

Hello Vitor
This is low priority but I thought I would ask. Getting URL invalid when trying to extract the audio. I tried to change the audio format to m4a (changed it back to mp3) but I fear I messed something else up (judging by the debug warning).
 
1) Terminal output:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 2 formulae.

Warning: youtube-dl 2020.11.19 already installed

2) Workflow version is v20.11
3) Alfred version is 4.2.1 [1187]
4) macOS version is 10.14.6 (Mojave)
5) Failing link: https://www.youtube.com/watch?v=ISDa3-rHgds
6) Debug output:
[09:16:37.460] Logging Started...
[09:16:43.373] DownMedia[Script Filter] Queuing argument ''
[09:16:43.889] DownMedia[Script Filter] Script with argv '' finished
[09:16:43.892] DownMedia[Script Filter] {"items":[{"uid":"downmedia audio","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"audio","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"audio","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"audio","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"audio","add_to_watchlist":false,"full_playlist":true}}},"title":"How-to Install Thunder Products TPI Torque Wings - YouTube","arg":"https://www.youtube.com/watch?v=ISDa3-rHgds"}]}
[09:16:45.057] DownMedia[Script Filter] Processing complete
[09:16:45.063] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=ISDa3-rHgds' to Run Script
[09:16:46.176] ERROR: DownMedia[Run Script] Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: invalid audio format specified
[09:16:46.183] DownMedia[Run Script] Processing complete
[09:16:46.184] DownMedia[Run Script] Passing output '' to Run Script
[09:20:18.579] DownMedia[Script Filter] Queuing argument ''
[09:20:19.132] DownMedia[Script Filter] Script with argv '' finished
[09:20:19.144] DownMedia[Script Filter] {"items":[{"uid":"downmedia audio","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"audio","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"audio","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"audio","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"audio","add_to_watchlist":false,"full_playlist":true}}},"title":"How-to Install Thunder Products TPI Torque Wings - YouTube","arg":"https://www.youtube.com/watch?v=ISDa3-rHgds"}]}
[09:20:20.137] DownMedia[Script Filter] Processing complete
[09:20:20.154] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=ISDa3-rHgds' to Run Script
[09:20:22.541] ERROR: DownMedia[Run Script] Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: invalid audio format specified
[09:20:22.558] DownMedia[Run Script] Processing complete
[09:20:22.559] DownMedia[Run Script] Passing output '' to Run Script

Link to comment
  • 1 month later...

@vitor

 

Just wanted to say that I ran into an issue downloading YouTube videos, dug around a bit, and then realized that your workflow has a dependency on youtube-dl for those links. Problem resolved itself after a brew upgrade.

 

The debug didn't offer much in the way of advice. Would it make sense to build in some validation of the dependencies when the script throws an error? That way it'd be just a little bit easier for us to "self serve" when an error occurs.

 

Goes without saying i'm incredibly grateful, not just for your plugin but also for the fact it's kept updated. 😁

Edited by ionstorm
Link to comment
14 hours ago, ionstorm said:

The debug didn't offer much in the way of advice. Would it make sense to build in some validation of the dependencies when the script throws an error?

 

The dependency was valid, only outdated. Sometimes even the latest version of youtube-dl can’t download a URL, or it may be an invalid website, or something else. Plus, you may be using a self-managed youtube-dl (brew) or the one the Workflow provides. It’s a lot of cases to consider with finicky solutions.


I’m open to discussing specific solutions, but I think all of them would have to go through linking to a document with all cases.

 

14 hours ago, ionstorm said:

Goes without saying i'm incredibly grateful, not just for your plugin but also for the fact it's kept updated.

 

Thank you for the kind words.

Link to comment
  • 1 month later...
  • 2 months later...
On 12/31/2020 at 4:06 AM, ionstorm said:

@vitor

 

Just wanted to say that I ran into an issue downloading YouTube videos, dug around a bit, and then realized that your workflow has a dependency on youtube-dl for those links. Problem resolved itself after a brew upgrade.

 

The debug didn't offer much in the way of advice. Would it make sense to build in some validation of the dependencies when the script throws an error? That way it'd be just a little bit easier for us to "self serve" when an error occurs.

 

Goes without saying i'm incredibly grateful, not just for your plugin but also for the fact it's kept updated. 😁

 

I'm having the same issue - previously working but not anymore - I don't think I have brew installed on this machine. How did you update it? If I hadn't installed brew before, would there be a different way to update the dependencies?

Link to comment

Hey Vitor

 

I think this one is something simple, but I can't put my finger on it. Getting a download failed message. Do I have another video stuck in a queue?

 

1) Warning: youtube-dl 2021.4.26 already installed

2) Version 21.4

3) 4.3.4 [1229]

4) macOS version is 10.14.6 (Mojave)

5) Failing link: https://www.youtube.com/watch?v=i_ttPiNlVjM

 

6)output...

[08:41:44.157] DownMedia[Script Filter] Queuing argument ''

[08:41:44.890] DownMedia[Script Filter] Script with argv '' finished

[08:41:44.894] DownMedia[Script Filter] {"items":[{"uid":"downmedia video","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"video","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":true}}},"title":"(1) Hard Enduro Training with Megs Braap - YouTube","arg":"https://www.youtube.com/watch?v=i_ttPiNlVjM"},{"uid":"downmedia video","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"video","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":true}}},"title":"https://www.youtube.com/watch?v=ajYVBiVotzA","arg":"https://www.youtube.com/watch?v=ajYVBiVotzA"}]}

[08:41:52.288] DownMedia[Script Filter] Processing complete

[08:41:52.312] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=i_ttPiNlVjM' to Run Script

[08:42:30.912] ERROR: DownMedia[Run Script] ERROR: [Errno 2] No such file or directory: '/Users/roccoapril/Downloads/Hard Enduro Training with Megs Braap.f137.mp4'

[08:42:30.925] DownMedia[Run Script] Processing complete

[08:42:30.927] DownMedia[Run Script] Passing output '' to Run Script

 

 

 

 

failed.png

Link to comment

@bazerman 

 

Try "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred._sharedresources/bin/youtube-dl" --update

 

@roccitman

 

Can’t reproduce.

 

6 hours ago, roccitman said:

ERROR: [Errno 2] No such file or directory: '/Users/roccoapril/Downloads/Hard Enduro Training with Megs Braap.f137.mp4'

 

This is weird, though. File name shouldn’t be that. Did you try it more than once and with more than one link? Do you have ffmpeg installed via homebrew?

Edited by vitor
Link to comment

Vitor you're a legend. Happy to pay for your time if you can identify what's going wrong here:

 

I've run that command, youtube-dl is now up to date, but still showing URL invalid. Last time I used the workflow successfully was 2-3 days ago.

image.png.a75355406fc22c28b2a2e8bfb6721a90.png

Video link below.

 

MacOS version: 11.2.3

Alfred version:  4.3.4

 

 

[18:08:50.910] Logging Started...

[18:08:56.567] DownMedia[Script Filter] Queuing argument ''

[18:08:56.948] DownMedia[Script Filter] Script with argv '' finished

[18:08:56.951] STDERR: DownMedia[Script Filter] /Applications/Alfred.alfredpreferences/workflows/user.workflow.BB99C167-5EC9-4A9D-8411-9EA25AE11CAD/get_title_and_url.js: execution error: Error: Error: You need a supported browser as your frontmost app (-2700)

[18:08:56.952] DownMedia[Script Filter] {"items":[{"uid":"downmedia video","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"video","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":true}}},"title":"https://www.youtube.com/watch?v=VDlBHm91FxM","arg":"https://www.youtube.com/watch?v=VDlBHm91FxM"}]}

[18:08:57.578] DownMedia[Script Filter] Processing complete

[18:08:57.578] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=VDlBHm91FxM' to Run Script

[18:08:59.819] ERROR: DownMedia[Run Script] ERROR: VDlBHm91FxM: YouTube said: Unable to extract video data

[18:08:59.825] DownMedia[Run Script] Processing complete

[18:08:59.826] DownMedia[Run Script] Passing output '' to Run Script

Edited by bazerman
Link to comment

@roccitman You haven’t answered all the questions.

 

@bazerman Does that happen with all videos or just the one? The error you’re getting is from youtube-dl and should be fixed by updating. I cannot reproduce the error. Also, you haven’t answered all the requested points; namely the first two.

Link to comment
25 minutes ago, vitor said:

@roccitman You haven’t answered all the questions.

 

@bazerman Does that happen with all videos or just the one? The error you’re getting is from youtube-dl and should be fixed by updating. I cannot reproduce the error. Also, you haven’t answered all the requested points; namely the first two.

 

Thanks - it was happening with all videos. Although it was saying youtube-dl is up to date, I tried again after using

 

sudo youtube-dl -U

 

and that's now working

 

Link to comment

Hey Vitor

 

Odd, I've been trying this video:

 

And it worked once in the five times I tried. But regardless of working or not, I get these extra two files with the extra .fxxx. at the end

No Joke bottom to top.f137.mp4

No Joke bottom to top.f140.m4a

 

Two debug outputs below, first was a fail, second was a success...

 

failed debug output...

[09:04:15.715] DownMedia[Script Filter] Queuing argument ''

[09:04:16.323] DownMedia[Script Filter] Script with argv '' finished

[09:04:16.326] DownMedia[Script Filter] {"items":[{"uid":"downmedia video","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"video","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":true}}},"title":"(1) No Joke bottom to top - YouTube","arg":"https://www.youtube.com/watch?v=beedCJz8P5E"}]}

[09:04:17.652] DownMedia[Script Filter] Processing complete

[09:04:17.659] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=beedCJz8P5E' to Run Script

[09:04:48.541] ERROR: DownMedia[Run Script] ERROR: [Errno 2] No such file or directory: '/Users/roccoapril/Downloads/No Joke bottom to top.f137.mp4'

[09:04:48.568] DownMedia[Run Script] Processing complete

[09:04:48.570] DownMedia[Run Script] Passing output '' to Run Script

 

successful debut output...

[09:08:59.966] DownMedia[Script Filter] Queuing argument ''

[09:09:00.565] DownMedia[Script Filter] Script with argv '' finished

[09:09:00.568] DownMedia[Script Filter] {"items":[{"uid":"downmedia video","subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): false","valid":true,"variables":{"media_type":"video","add_to_watchlist":true,"full_playlist":false},"mods":{"cmd":{"subtitle":"Add to WatchList (⌥): true 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","Add_to_watchlist":true,"full_playlist":true}},"alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): false","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":false}},"cmd+alt":{"subtitle":"Add to WatchList (⌥): false 𐄁 Full Playlist (⌘): true","variables":{"media_type":"video","add_to_watchlist":false,"full_playlist":true}}},"title":"(1) No Joke bottom to top - YouTube","arg":"https://www.youtube.com/watch?v=beedCJz8P5E"}]}

[09:09:01.324] DownMedia[Script Filter] Processing complete

[09:09:01.332] DownMedia[Script Filter] Passing output 'https://www.youtube.com/watch?v=beedCJz8P5E' to Run Script

[09:09:31.693] STDERR: DownMedia[Run Script] xattr: No such file: /Users/roccoapril/Downloads/No Joke bottom to top.mp4

55:207: execution error: Alfred 4 got an error: Cannot find workflow with Id 'com.vitorgalvao.alfred.watchlist' (-2)

You do not have WatchList installed. Download it at https://github.com/vitorgalvao/alfred-workflows/tree/master/WatchList

[09:09:31.702] DownMedia[Run Script] Processing complete

[09:09:31.703] DownMedia[Run Script] Passing output '' to Run Script

Link to comment
3 hours ago, roccitman said:

And it worked once in the five times I tried.

 

That’s odd, and seeing as no one else is experiencing it, it has to be something in your setup.

 

3 hours ago, roccitman said:

But regardless of working or not, I get these extra two files with the extra .fxxx. at the end

 

I’d say that’s an issue with your installation of ffmpeg. Confirm if you have it, and how it’s installed.

Link to comment
4 hours ago, vitor said:

I’d say that’s an issue with your installation of ffmpeg. Confirm if you have it, and how it’s installed.

 

Got this with the ffmpeg -version command

 

Roccos-MacBook-Pro:~ roccoapril$ ffmpeg -version
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

Link to comment
  • 2 months later...
1 hour ago, srb1961 said:

Is it possible to change the default download location to Desktop?

 

From the README (emphasis added):

 

Quote

The Workflow Environment Variables represent the directory to download to, the audio format to save when using da, and the default behaviour of adding a download to WatchList (true or false).

 

Link to comment
  • 2 months later...

Heads up on a possible future change.


Right now, this Workflow uses youtube-dl. If you don’t have it, the Workflow will install and update it for you without messing with your system.


As you may know, youtube-dl’s development is stalled. As far as I’m aware, the developers stopped frequenting the repo and haven’t appointed successors. While it isn’t broken yet, it’s a matter of time if the situation doesn’t change. Forks began to crop up, yt-dlp rising in popularity.


I want to switch the Workflow to yt-dlp, but it poses a challenge: it depends on Python 3, which does not ship with macOS. That means—unlike youtube-dl—downloading it isn’t a guarantee it will run. It will if installed with Homebrew.


Supporting two versions of the Workflow isn’t viable. But I also don’t want to raise the dependency use of (and answer support requests from) dozens of people without warning.


Current plan:


Release a version which uses youtube-dl but checks if you have yt-dlp installed. If you do, It will continue its update track to the new Workflow version. If you don’t, a message will be shown to the debugger warning you need to install yt-dlp and not check for updates.


This way the Workflow won’t break due to the new dependency and people can move slowly as they have issues. New users will use the new versions from the start.


I’m open to other ideas. If nothing betters is suggested until the end of the week, I’ll proceed with the above.

Link to comment

There were no objections or comments to the previous post, so the (probable) last version using youtube-dl is now out. If you have yt-dlp, it’ll continue checking for updates, but if you don’t it won’t.


I’ll release the first version using yt-dlp at a later point. It may take up to a month to ensure everyone is on the current one.


Still open to suggestions of a better way to include yt-dlp with the Workflow.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...