qnblackcat / uYouPlus

uYou+ is a modified version of uYou (made by @MiRO92) with additional features and mainly made for non jailbroken users!
7.23k stars 8.72k forks source link

[Enhancement] Userscript to automatically prompt to open YouTube app #69

Closed asportnoy closed 2 years ago

asportnoy commented 2 years ago

I made a userscript to automatically prompt you to open the YouTube app when you open a YouTube link in safari. I already had a Siri shortcut to do this, but I prefer this because it will automatically prompt you instead of having to dig through the share menu.

Safari extension to run user script (free): https://apps.apple.com/us/app/userscripts/id1463298887 Userscript code: https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000

How to install

1) Install the app 2) Launch the app and choose path for scripts 3) Go to this page 4) Open the extension and press install in the banner

Write commented 2 years ago

Thanks a lot for this script. Would it be possible to add a way to open directly the link in the app, like Apollo app is doing ?

asportnoy commented 2 years ago

Automatic open in app (including from Apollo) works by using Apple's smart banners. Those require you to get the app ID, which only app store apps have.

Write commented 2 years ago

Ok thanks a lot !

tonysprenk commented 2 years ago

I have downloaded the userscript extension, I have enabled it, I have set the userscript directory, I have downloaded the above script to the directory. When I open a YouTube link I don’t get the open in YouTube pop-up, what am I doing wrong?

ilm91 commented 2 years ago

Awesome! Can you write a code for BHTwitter+ too, which do the same thing, but for the modified Twitter "BHTwitter Plus"?

BHTwitter Plus: https://github.com/qnblackcat/BHTwitter-Plus_Sideloaded/#download-ipa

qnblackcat commented 2 years ago

@asportnoy I‘ve added your solution to the FAQ page. https://github.com/qnblackcat/uYouPlus/wiki/FAQ#q-deep-link-aka-open-in-the-youtube-app-doesnt-work

asportnoy commented 2 years ago

Awesome! Can you write a code for BHTwitter+ too, which do the same thing, but for the modified Twitter "BHTwitter Plus"?

BHTwitter Plus: https://github.com/qnblackcat/BHTwitter-Plus_Sideloaded/#download-ipa

@ilm91 With Twitter, you would have to do more parsing of the URL to format it into the URL scheme. The URL schemes for Twitter are listed here.

qnblackcat commented 2 years ago

Technically , this is not an issue. I’ll close it but still keep it pinned.

fefifofum commented 2 years ago

Maybe this is worth checking out...

https://github.com/CokePokes/YoutubeExtensions

qnblackcat commented 2 years ago

YouTubeExtensions (by CokePokes) has been added since v17.17.4-2.1. This user script is most likely not needed anymore.

anhnlh commented 2 years ago

Hey is it possible to modify the script code to also close the tab in safari as well?

Sorry for opening the issue up again, I wanted to ask because I can't set up YoutubeExtensions by CokePokes

codexss commented 1 year ago

Awesome! Can you write a code for BHTwitter+ too, which do the same thing, but for the modified Twitter "BHTwitter Plus"?

BHTwitter Plus: https://github.com/qnblackcat/BHTwitter-Plus_Sideloaded/#download-ipa

https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f

Try this

anhnlh commented 1 year ago

That didn't really help, but I added an update to the script that closes the tab after 5 seconds. You should be able to tap the open in app button quick enough for the tab to close by itself lol. It seems like it's working for me.

Modified script: https://gist.github.com/aln4739/2c04dc54d09e68c73eaccf13266950a1

dudu-castro commented 1 year ago

I made a userscript to automatically prompt you to open the YouTube app when you open a YouTube link in safari. I already had a Siri shortcut to do this, but I prefer this because it will automatically prompt you instead of having to dig through the share menu.

Safari extension to run user script (free): https://apps.apple.com/us/app/userscripts/id1463298887 Userscript code: https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000

How to install

  1. Install the app
  2. Launch the app and choose path for scripts
  3. Go to this page
  4. Open the extension and press install in the banner

Hey bro, how can I do a userscript to open Rocket Instagram and Tiktok automatically as you do? Can u help me?

lui75 commented 1 year ago

Hi! Would it be possible for you to modify the script in order to let it works with Chrome too? Thanks for your time.

yodaluca23 commented 1 year ago

Hi! Would it be possible for you to modify the script in order to let it works with Chrome too? Thanks for your time.

Bro, extensions only work in Safari, dummy...

ryuya0124 commented 9 months ago

Some YouTube channel pages (youtube://www.youtube.com/@....) Fixed because it does not work correctly on

https://gist.github.com/ryuya0124/2ba4f56cf9e9dab781d3146c74a3f36b

asportnoy commented 9 months ago

Some YouTube channel pages (youtube://www.youtube.com/@....) Fixed because it does not work correctly on

https://gist.github.com/ryuya0124/2ba4f56cf9e9dab781d3146c74a3f36b

I can't reproduce that issue, it works on my version too.

ryuya0124 commented 8 months ago

I wrote a script for BHTwitter. It analyzes the URL scheme and opens more pages. The list redirects to the timeline because the URL scheme is unknown. Pages that could not be handled are also redirected to the timeline to avoid errors.

https://gist.github.com/ryuya0124/e6e59ceba8f03bf40f3b5accedc52e44

ryuya0124 commented 8 months ago

Some YouTube channel pages (youtube://www.youtube.com/@....) Fixed because it does not work correctly on https://gist.github.com/ryuya0124/2ba4f56cf9e9dab781d3146c74a3f36b

I can't reproduce that issue, it works on my version too.

In older versions, for example, if you opened this link, the YouTube app could not process it and redirected you to the browser.

https://youtube.com/@wdsgame_official?si=m7_Yk-Vj02go6ozm