Scan with your iPhone to install
Preview
Usage:
Minimize any YouTube video you want from safari or YouTube application.
What's New
Version 1.0
First release
What it does
49 actions-
CommentAuthor: Ari R. Abdulla Usage: Minimize any YouTube video you want.
-
If
-
Get Type
-
Set VariableShortcut Type
-
If
-
Text
-
If
-
Run JavaScript on Web Page
-
Stop This Shortcut
-
If
-
Show Alert
-
Stop This Shortcut
-
If
-
Text
-
Set VariableShortcut Text
-
If
-
Set VariableShortcut Input
-
Nothing
-
If
-
Show Alert
-
Stop This Shortcut
-
If
-
Get Clipboard
-
If
-
Set VariableShortcut Input
-
Nothing
-
If
-
If
-
Set VariableShortcut Input
-
Nothing
-
If
-
Show Alert
-
Stop This Shortcut
-
URL…
-
Set VariableLink
-
If
-
Nothing
-
If
-
Replace Text
-
Set VariableLink
-
Text
-
Run Script Inlinedk.simonbs.Scriptable
-
Get Dictionary from Input
-
Get Dictionary Value
-
Set VariableFinalURL
-
Open URLs
-
Wait
-
Open App
-
Stop This Shortcut
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/web'
#define color darkblue
#define glyph shrinkArrow
/*
Author: Ari R. Abdulla
Usage:
Minimize any YouTube video you want.
*/
if ShortcutInput {
typeOf(ShortcutInput)
@ShortcutType
if @ShortcutType contains "Safari" {
const Text = "{ShortcutInput}"
if Text contains "youtube.com" {
runJavaScriptOnWebpage("let v = document.querySelector('video');\nv.addEventListener('webkitpresentationmodechanged', (e)=>e.stopPropagation(), true);\n\nsetTimeout(()=>v.webkitSetPresentationMode('picture-in-picture'), 3000);\n\ncompletion()")
stop()
} else {
confirm("It seems that it's not a YouTube Link!!!")
stop()
}
} else {
@ShortcutText = "{ShortcutInput}"
if @ShortcutText contains "youtube.com" {
@ShortcutInput = @ShortcutText
} else {
confirm("It seems that it's not a YouTube Link!!!")
stop()
}
}
} else {
const Clipboard = getClipboard()
if Clipboard contains "youtube.com" {
@ShortcutInput = Clipboard
} else {
if Clipboard contains "youtu.be" {
@ShortcutInput = Clipboard
} else {
confirm("First copy one YouTube link!")
stop()
}
}
}
url(@ShortcutInput)
@Link
if @Link contains "watch" {
} else {
replaceText("youtu.be/", "youtube.com/watch?v=", @Link)
@Link
}
rawAction("dk.simonbs.Scriptable.RunScriptInlineIntent", {
"Show-texts": true,
"Show-urls": true,
"ShowWhenRun": false,
"runInApp": false,
"script": "let url = \\\"{@Link}\\\", \\ncitem = \\\"Download Video\\\";\\n{}"
})
const Dictionary = getDictionary(Output)
@FinalURL = Dictionary['url']
openURL(@FinalURL)
wait(5)
openApp("com.google.ios.youtube")
stop()
Open in Cherri Playground
Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.
Ratings & Reviews
Write a Review–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Advertisement
More by arirafiq
You Might Also Like
Advertisement