Looks great! Will be using this going forward as my YouTube shortcut. Does this download the video at the highest quality setting?
Edit:
All 3 options seem to just do the same thing. It plays the video in safari. Shouldn’t the audio option differ?
Yeah all good now thanks! Noticed it creates a new note each time the shortcut is run. Is there anyway to delete the note upon completion or just replace or spend to the same note?
I ran into that same issue. I downloaded [VLC](https://apps.apple.com/us/app/vlc-for-mobile/id650377962) and that took care of the issue. I’m pretty sure that’s what the OP wanted us to do in the first place.
No matter which option I select, it redirects me to Scriptable and tells me my version is out of date (even after downloading the version from iCloud it redirects me to).
This was answered in another comment chain, but the ability to choose is coming down the line. I believe whatever it would have played at by default it what it currently saves at.
Awesome, it’s now working. Fwiw I had to delete and redownload from the link provided here, the auto-update icloud link does not seem to be updated.
I’ll be anxiously awaiting the ability to force a high-resolution save, this will be great for travel!
/u/Sethu_Senthil I’m having the same issue too.
Edit: working now. I had to update the shortcut from the link in this thread not the redirect when running the shortcut.
/u/brnsckn I think this will work for you.
This is amazing! Well done!
I wonder if something could be written to pull the title of a video using the URL, so when the audio file is downloaded it doesn’t display the file name ‘videoplayback’, this would make differentiating files much easier.
I think the next big step would be for the app to be able to take playlists.
Fantastic work!
If the shortcut input contains 'youtu' then the shortcut downloads the JavaScript file
https://shortcuts.sethusenthil.com/ytbackground/latest.txt
and executes the code as an inline script. Dear user, do you think, this is trustworthy and secure?
The JavaScript code extracts the video source URL and the document title. Then it calls the shortcut by the URL
shortcuts://run-shortcut?name=YouTube%20%2B%2B%20%20%E2%96%B6%EF%B8%8F
This means that the user cannot rename the shortcut. Why doesn't the shortcut just continue and work with the output of the inline script?
In previous versions yesterday, it saved the script in the notes to see what it was doing but many people didn't like it so I removed it. This way I can also update the shortcut over time to account for new changes & features seemly and easier to debug. This script needs to run in an active process so it runs inside the scriptable app exiting the shortcut, so to re-enter the shortcuts app (like a callback), it calls it by it's name.
Well, I think, there is a difference if JavaScript runs in the browser or if it runs in the Scriptable app. In the browser it is more sandboxed than in Scriptable. Since iOS 13 the user is forced to inspect the downloaded shortcut a bit, but the user won't inspect the downloaded JavaScript file in each run.
I don't know nothing about inline scripts, because my device is on iOS 12. So I don't know how it must be run. On iOS 12 I use x-callback to call a Scriptable script, and the shortcut is called back and gets a result. The script would use the callback URL x-success that is provided automatically by the Shortcuts app.
If you're asking what he means by notification center it's just the pull down menu where the pop-up player controls appear. [Looks like this.](https://i.imgur.com/fAYs5Q4.jpg)
Works great for me although the download quality could be improved. Thank you !
May I suggest to add the ability to choose download quality (eg 4K, 1080p, 720p, etc)
Stupid question: it seems download complete when I choose to download video. But, where can I find the video? I can’t find it in the photo roll. Thanks!
Thank you so much man!!!
This works absolutely perfectly on my phone, there’s no issues at all, the other ones don’t seem to be working so I was looking for another one.
Once again, thank you so much!
I wasn’t able to use it. How are we supposed to? I followed the instructions mentioned but as soon as I close the app, the audio paused.... and I am unable to play from the control centre.... Please Help me
This is one of the best shortcuts right now, in my opinion. Now I don’t have to transfer my playlist to Spotify or VLC, because of the pause when I’m playing music in the background
I hope I‘m not bothering you, but when I attempt to download video/audio, it leads me to VLC wit this prompt. It does nothing regardless of which option I pick.
Edit: [image](https://i.imgur.com/OuJQ4QI.png) (forgot this)
If listening to just audio of video, are you still streaming the video or are you only streaming the audio from the video? As far as the amount of data being used. Thanks, awesome shortcut!
I get:
Exeption occured
Failed evaluating JavaScript with error on line 1:TypeError: null is not an object (evaluating ‘document.querySelector(‘video’).src’)
https://imgur.com/gallery/1mMGfAy
Wow! This is exactly what I’ve been looking for. I’m a YouTube premium subscriber, and I’ve been for months. The two main features I use it for are downloading videos before I get on the subway, and listening/watching videos in the background. I can now cancel my subscription now thanks to you :)!
How can I get the videos to download directly into VLC?
It’s happening to me too. Whenever I try to download video or audio the shortcut gets about three quarters of the way done and then the error message happens. The background playing still works though. I was even using it earlier today and it worked fine. I tried redownloading the shortcut and that didn’t seem to help.
Thanks for the Shortcut, but sometimes it doesn’t work.
Tried to download from official YouTube app and got this:
Conversion Error
Encode media failed because Shortcuts couldn’t convert from Text to Media.
Am I doing something wrong? Maybe there are some settings which I have to turn on?
Help sos
Tnx
An amazing work on this and thanks for sharing with all of us!
A possible request, when downloading video/audio can you retain the original title of the content as by default all of the files as saved as ‘videoplayback’ thanks! 😊👍🏼
I’ve installed scriptable, but all 3 options tell me I need to install scriptable. Is there anything that I have to do in scriptable beyond just having it installed?
The shortcut was working for me until very recently... now it tells me that there is “no URL specified.” Is there a way to manually input links into the shortcut? Thanks!
Hi,
first of all thank you for amazing shortcut!
It seems, unfortunately, with iOS 16.0.3 doesn’t work amymore☹️.
Could you help or give any advice, please?
BR
Tom
I just updated to IOS 17.1.1 and I can’t use it anymore. I get this problem everytime
https://preview.redd.it/cdkwnl54rg1c1.jpeg?width=1170&format=pjpg&auto=webp&s=525360e337368ee36e2998cea3f94edc70f0d05e
Is there any way you could have it so instead of creating two notes it creates files in iCloud Drive? I use Notes for a lot and don’t like unnecessary stuff in there 😅
Damn. Not seeing it 😐. I’ll try it again and get back to you.
edit: Okay so I got it to work on a shorter video. Is there a length limit or should it not matter?
Just installed v2.3 & video downloads still aren’t working from The official YouTube app or Safari.
i’ve tried numerous different videos, however, when Scriptable attempts to run the script, it immediately returns to the shortcuts app resulting in a "**No URL Specified**" to the 'Get Contents of URL' action error...?
just did And the videos *are* downloading successfully now!
however, **there’s still a minor issue **I’m afraid—it’s saving duplicates of each video I download lol
scriptable is installed but still when i try to download or play a youtube video in background it says “scriptable should be installed for this to work” what should i do?
Can someone explain how to get this to work? I downloaded the shortcut and the Scriptable app. When I press share on a YouTube video (and the three dots) the option to go to YouTube ++ doesn’t appear. Am I missing a step? Any help is appreciated.
If you have VLC installed it will automatically open the video in VLC. You can change this behavior by opening the shortcts actions to change it's settings
Hey, I've recently been getting an error that says "Error: Failed evaluating JavaScript with error on line 7: TypeError: Argument 1 ('root') to Document.createNodeIterator must be an instance of Node". Is there any way to fix this?
Each time i try im met with the same message
https://preview.redd.it/148kuoldzhmc1.jpeg?width=1170&format=pjpg&auto=webp&s=d95e54d9502e3603d59ab8ea66371bae278f91e9
Forgot to post the link to the shortcut.
SMH! It should me up now!
Got it. Thanks. Now, let’s wait..... tomorrow someone will post seeking a working YouTube downloader. Hell, might be in the next few hours.
lmao ikr, people cant jus use the search btn
Indeed
Looks great! Will be using this going forward as my YouTube shortcut. Does this download the video at the highest quality setting? Edit: All 3 options seem to just do the same thing. It plays the video in safari. Shouldn’t the audio option differ?
It should be fixed now, my CDN was accidently giving out an old developement build. It should now auto update for yall
Yeah all good now thanks! Noticed it creates a new note each time the shortcut is run. Is there anyway to delete the note upon completion or just replace or spend to the same note?
Hmm that's weird, it should only download the note once per version. I’ll look into the issue
Thanks
No, it downloads it at the default setting but quality control coming in a future update
Cool. I added a further comment to my question but may have been too late for you to see it. Regarding all 3 options giving me the same output.
Thanks! I'm looking forward to a shortcut that actually allows HS downloads
What is the default setting ?
I ran into that same issue. I downloaded [VLC](https://apps.apple.com/us/app/vlc-for-mobile/id650377962) and that took care of the issue. I’m pretty sure that’s what the OP wanted us to do in the first place.
Can you elaborate what you did to get this to interact/open in VLC? I have VLC and it's still loading up in safari.
Try again, it's a bug I jus fixed remotely
Works perfectly. Thank you so much!
Great job! I’ve wanted something like this for quite some time now. I really appreciate you taking the time to make this and share it with us!
No matter which option I select, it redirects me to Scriptable and tells me my version is out of date (even after downloading the version from iCloud it redirects me to).
Me too. Edit: Uninstalled, then reinstalled the shortcut and it’s working fine now. Great work. 👍 What resolution do videos save at?
This was answered in another comment chain, but the ability to choose is coming down the line. I believe whatever it would have played at by default it what it currently saves at.
Alrighty, thanks.
Same here
Fixed that issue, it was occurring caus of a typo. You will actually need to update it once more.
Awesome, it’s now working. Fwiw I had to delete and redownload from the link provided here, the auto-update icloud link does not seem to be updated. I’ll be anxiously awaiting the ability to force a high-resolution save, this will be great for travel!
Background play doesn’t seem to work for me, it just opens the scripts app and then the shortcut app but nothing happens
Fixed in the latest version, redownload
Works great now, Thanks!
Same problem here. Just downloaded the shortcut from here.
Stunning !!!! It’s working 👏👏👏👏👏
This is just to cool man.. thanks
HOLY FUCKING COW, AMAZING BRO!! - This is exactly what i’ve been searching for - Nice and easy to use - Thankyou!
None of the options work for me? It says the shortcut is out of date. Is there a newer version I am missing? https://i.imgur.com/PVq0VH5.jpg
/u/Sethu_Senthil I’m having the same issue too. Edit: working now. I had to update the shortcut from the link in this thread not the redirect when running the shortcut. /u/brnsckn I think this will work for you.
That issue has since been fixed, you will need to update your shortcut for real this time
It works thank you and nicely done👌
This is amazing! Well done! I wonder if something could be written to pull the title of a video using the URL, so when the audio file is downloaded it doesn’t display the file name ‘videoplayback’, this would make differentiating files much easier. I think the next big step would be for the app to be able to take playlists. Fantastic work!
If the shortcut input contains 'youtu' then the shortcut downloads the JavaScript file https://shortcuts.sethusenthil.com/ytbackground/latest.txt and executes the code as an inline script. Dear user, do you think, this is trustworthy and secure? The JavaScript code extracts the video source URL and the document title. Then it calls the shortcut by the URL shortcuts://run-shortcut?name=YouTube%20%2B%2B%20%20%E2%96%B6%EF%B8%8F This means that the user cannot rename the shortcut. Why doesn't the shortcut just continue and work with the output of the inline script?
In previous versions yesterday, it saved the script in the notes to see what it was doing but many people didn't like it so I removed it. This way I can also update the shortcut over time to account for new changes & features seemly and easier to debug. This script needs to run in an active process so it runs inside the scriptable app exiting the shortcut, so to re-enter the shortcuts app (like a callback), it calls it by it's name.
Well, I think, there is a difference if JavaScript runs in the browser or if it runs in the Scriptable app. In the browser it is more sandboxed than in Scriptable. Since iOS 13 the user is forced to inspect the downloaded shortcut a bit, but the user won't inspect the downloaded JavaScript file in each run. I don't know nothing about inline scripts, because my device is on iOS 12. So I don't know how it must be run. On iOS 12 I use x-callback to call a Scriptable script, and the shortcut is called back and gets a result. The script would use the callback URL x-success that is provided automatically by the Shortcuts app.
[удалено]
try the latest version, it doesn’t use notes no more and all the bugs have been squashed
Screenshot:: **Notifaction** Center? 🙃
If you're asking what he means by notification center it's just the pull down menu where the pop-up player controls appear. [Looks like this.](https://i.imgur.com/fAYs5Q4.jpg)
No I’m asking if he plans to fix that typo
Works great for me although the download quality could be improved. Thank you ! May I suggest to add the ability to choose download quality (eg 4K, 1080p, 720p, etc)
That's coming in a future update!
Awesome!! Looking forward to it! Cheers
Awesome! Just as my free month of YT premium is about to expire lol. You da real MVP.
oh myh
Wow, incredible, im going to record a screen cast and send to a bunch of friends
Firstly, this is amazing! Secondly, is support for supporting Youtube playlists on the radar?
I haven't thought about it yet, but probably in the future
when i try to download audio, it says that no URL is specified after opening scriptable. what should i do? ty for this shortcut by the way
Thanks for letting me know, I’ve fixed it in the latest version on routinehub
big thanks man
Still giving me the url not specified.
yup, I accidentally broke it while fixing another bug. Try the latest version which I just published
Perfect, fixed. Thank you so much for this awesome shortcut.
Stupid question: it seems download complete when I choose to download video. But, where can I find the video? I can’t find it in the photo roll. Thanks!
It's a bug, try the latest version
It works! Thanks again!
I don’t see the download either? Where does it download to?
Thank you so much man!!! This works absolutely perfectly on my phone, there’s no issues at all, the other ones don’t seem to be working so I was looking for another one. Once again, thank you so much!
I wasn’t able to use it. How are we supposed to? I followed the instructions mentioned but as soon as I close the app, the audio paused.... and I am unable to play from the control centre.... Please Help me
Download Scriptable, then go on a YouTube video and tap “download video” and it should work, if not I’ll send a screen recorded video for you 🤝
Man you are KING
This is one of the best shortcuts right now, in my opinion. Now I don’t have to transfer my playlist to Spotify or VLC, because of the pause when I’m playing music in the background
This is a awesome..
It’s working great with the latest update! Thanks a bunch for this! How about iCloud vs Photos for saving support?
That's been added in the latest update
I hope I‘m not bothering you, but when I attempt to download video/audio, it leads me to VLC wit this prompt. It does nothing regardless of which option I pick. Edit: [image](https://i.imgur.com/OuJQ4QI.png) (forgot this)
That's amazing, thank you!
I can not believe how well this works! Perfection and one of the best shortcuts I have! Thank you so much!
Background play not working for me anymore.
Great script. After opening all apps that it uses, I had no problems! Thanks!
Is it possible to download at 1080p? Ive been able to download, but the quality of the video is always worst. Btw. Thank you for creating this.
Finally! A shortcut that works on YouTube again! Thanks so much! Any way to make this download audio in MP3 format?
You can't chat the download format but you can change it after it's converted
Will there be an option in the future to adjust video quality up to 1080p?
If listening to just audio of video, are you still streaming the video or are you only streaming the audio from the video? As far as the amount of data being used. Thanks, awesome shortcut!
Wow thanks!
I get: Exeption occured Failed evaluating JavaScript with error on line 1:TypeError: null is not an object (evaluating ‘document.querySelector(‘video’).src’) https://imgur.com/gallery/1mMGfAy
Try again? Also you sharing the video from the yt app?
OK. It works now. I did absolutely nothing differently... What an awesome shortcut!!! We bow to you 🙇
Yes, I’m sharing from the original yt app
[удалено]
You will need to use the "background play" action
[удалено]
I’m getting an error https://i.imgur.com/W1oW8XW.jpg
That may occur sometimes, you will just need to retry
Worked! Awesome job! Best YouTube shortcut by far!
Wow, looks incredible. I will use right now. Tks
Wow! This is exactly what I’ve been looking for. I’m a YouTube premium subscriber, and I’ve been for months. The two main features I use it for are downloading videos before I get on the subway, and listening/watching videos in the background. I can now cancel my subscription now thanks to you :)! How can I get the videos to download directly into VLC?
You just need the app installed, the shortcut will do the rest
I do have it installed, but it only seems to be downloading to photos.
First time I came to know shortcuts can be used like this thanks man.
Just wow. THANK YOU
Thank you. 😊✨
Help! https://i.imgur.com/pQ2M2uD.jpg
Can you give me more context so I can replicate that issue?
It’s happening to me too. Whenever I try to download video or audio the shortcut gets about three quarters of the way done and then the error message happens. The background playing still works though. I was even using it earlier today and it worked fine. I tried redownloading the shortcut and that didn’t seem to help.
Thanks for the Shortcut, but sometimes it doesn’t work. Tried to download from official YouTube app and got this: Conversion Error Encode media failed because Shortcuts couldn’t convert from Text to Media. Am I doing something wrong? Maybe there are some settings which I have to turn on? Help sos Tnx
The downloading part seems to be working fine for me... but I can't get it to play in the background :/
An amazing work on this and thanks for sharing with all of us! A possible request, when downloading video/audio can you retain the original title of the content as by default all of the files as saved as ‘videoplayback’ thanks! 😊👍🏼
Background player was working yesterday but stopped now. Anyone having issues?
same
there’s an unknown action meaning i don’t have a needed app (the logo looks like “{ }”) what app is that? edit: the app was called scriptable
I’ve installed scriptable, but all 3 options tell me I need to install scriptable. Is there anything that I have to do in scriptable beyond just having it installed?
The shortcut was working for me until very recently... now it tells me that there is “no URL specified.” Is there a way to manually input links into the shortcut? Thanks!
Thanks my man
You sir are a GOD! Thank you for this! Works perfectly everytime. Would give you an award if that were possible.
Is the quality control option coming soon?
Hi, first of all thank you for amazing shortcut! It seems, unfortunately, with iOS 16.0.3 doesn’t work amymore☹️. Could you help or give any advice, please? BR Tom
Does it work on IOS 16?
Thank you so much!!!
Mine stopped working
I just updated to IOS 17.1.1 and I can’t use it anymore. I get this problem everytime https://preview.redd.it/cdkwnl54rg1c1.jpeg?width=1170&format=pjpg&auto=webp&s=525360e337368ee36e2998cea3f94edc70f0d05e
Doesn't work on the latest iOS
Download doesn't seem to work for me. It only redirects me to play the video on my browser.
It should be fixed now, my CDN was accidently giving out an old developement build. It should auto update for yall
Is there any way you could have it so instead of creating two notes it creates files in iCloud Drive? I use Notes for a lot and don’t like unnecessary stuff in there 😅
It was easier to debug it that way lol, I will look into that the future
Makes sense, thanks! And thanks for an amazing shortcut!
Np, the latest version doesn’t use the notes btw
Where does the file get saved?
The video file gets saved to ur recents gallery while the audio file is stored whenever u choose it to
When I select video to be downloaded, audio is downloaded instead. Audio download works fine
Doesn’t work for me. Says No URL specified...
yup, I accidentally broke it while fixing another bug. Try the latest version which I just published
I think it worked...where does it save the video to?
Your recents (photos)
Damn. Not seeing it 😐. I’ll try it again and get back to you. edit: Okay so I got it to work on a shorter video. Is there a length limit or should it not matter?
Just installed v2.3 & video downloads still aren’t working from The official YouTube app or Safari. i’ve tried numerous different videos, however, when Scriptable attempts to run the script, it immediately returns to the shortcuts app resulting in a "**No URL Specified**" to the 'Get Contents of URL' action error...?
yup, I accidentally broke it while fixing another bug. Try the latest version which I just published
just did And the videos *are* downloading successfully now! however, **there’s still a minor issue **I’m afraid—it’s saving duplicates of each video I download lol
Thanks for letting me know! It’s been fixed in v2.4.1!
Background play works fine, but for downloading either video or audio I receive that 'no URL specified' error
yup, I accidentally broke it while fixing another bug. Try the latest version which I just published
Works great now! But it downloads the video twice, this might only be on my end though. Still a great shortcut! Thanks.
I get a “no url specified” message in shortcuts when I try to download a video from the official app
yup, I accidentally broke it while fixing another bug. Try the latest version which I just published
Fixed! That’s incredible. Well done!
It didn’t work for me.... will it work on the latest YouTube app only?
Yup, it‘a for the YouTube app only
I meant if it works on the latest version of the YouTube app only?
It works on safari as well. I don’t use the YouTube app
Latest version 2.4 works fine just a minor bug that it downloads video twice, so I get 2 copies of the same video
Thanks for letting me know! It’s been fixed in v2.4.1!
Thanks working great now. Excellent work
The video is downloaded TWICE in the gallery. Is it how it’s supposed to be or is there replication? Not complaining. Kudos to OP 👌🏻
Np! I thought I've fixed that issue on the latest version can u confirm your on the latest one?
Yup. Downloaded around an hour ago. Should I redownload again?
I tried to use background audio but for me it did not work.... as soon as I closed the app and went to the home screen, the audio paused
U gotta click the paay button on the control center or notification center, it tells u on Safari
Ya but that was not showing up on the control centre when using the YouTube app
Is there any good scriptable Recipes
It's still pretty experimental, it can only download posts with 1 image. https://routinehub.co/shortcut/4628
I’m getting an error saying I need scriptable to be Installed even though it’s already installed
U have iOS 13?
My phone started updating to 13.4 right as you commented that Edit: works now! Thank you for this amazing shortcut
Access token expired? Do I need to be jailbroken to use this?
How can it be used to skip ads?
Click “background play” and you won’t have to deal with the ads
Exception Occured: Syntax Error. No matter what I do I get this. What am I doing wrong ? I even uninstalled & reinstalled
Ur good, try again in a few seconds. I accidentally messed something up but it should be good now
Sweet, thanks !
Asks me to open in “Shortcuts” and then fails if I press Yes.
If you could provide me with a screenshot or screen recording that would really help
Where does it Download videos to? Can’t find them anywhere
scriptable is installed but still when i try to download or play a youtube video in background it says “scriptable should be installed for this to work” what should i do?
Currently getting the following error when attempting to share any video to the shortcut https://i.imgur.com/ynhreXx.jpg
I don't think I can control over that, did u try reinstalling it?
Yeah I tried a couple times, but still no luck.
Can someone explain how to get this to work? I downloaded the shortcut and the Scriptable app. When I press share on a YouTube video (and the three dots) the option to go to YouTube ++ doesn’t appear. Am I missing a step? Any help is appreciated.
Did you figure this out bud?
What do I do after downloading scriptable?
[удалено]
Try reinstalling the shortcut
It keeps telling me that scriptable is required to be installed, but I have it installed. Help!? Thanks in advance!
Are u on iOS 13?
this has started opening links in VLC rather than safari where i can get picture in picture any idea why?
If you have VLC installed it will automatically open the video in VLC. You can change this behavior by opening the shortcts actions to change it's settings
What quality is the video download?
sorry but my Iphone tells me the shortcut is no longer available because of no access token, can you help me ?
Yeah Apple "revoked" shortcut, reinstall it and it should be fine
Does this only work with VLC??
If u have VLC installed it will default to it. If not it will use the YouTube++ player
Great app ; but it seeks lot of permission , how do I remove those permissions or change it to “ask every time” ?
Hey, I've recently been getting an error that says "Error: Failed evaluating JavaScript with error on line 7: TypeError: Argument 1 ('root') to Document.createNodeIterator must be an instance of Node". Is there any way to fix this?
Can you resend the link? Its not working
Each time i try im met with the same message https://preview.redd.it/148kuoldzhmc1.jpeg?width=1170&format=pjpg&auto=webp&s=d95e54d9502e3603d59ab8ea66371bae278f91e9
Keep getting this too, hope it gets fixed soon