ShareShortcuts

uTube PiP

Usage: Minimize any YouTube video you want from safari or YouTube application

arirafiq
„uTube PiP“ forken

Hast du auf Basis dieses Kurzbefehls etwas Neues erstellt? Teile ihn als Fork: Er wird zu deinem eigenen Kurzbefehl, den du selbst verwaltest, und beide Seiten verlinken aufeinander, damit arirafiq die Anerkennung erhält.

  1. 1Lade den Kurzbefehl und ändere ihn in der Kurzbefehle-App. Gib ihm einen eigenen Namen.
  2. 2Teile ihn in der Kurzbefehle-App und kopiere den iCloud-Link.
  3. 3Komm hierher zurück, füge den Link ein und beschreibe, was sich geändert hat, z. B. „Einen Schritt hinzugefügt, der Apple Intelligence nutzt, um den Text zu personalisieren.“
Downloads
57K
Gesichert
2
Aktionen
49
Kategorie
Streaming
Version
1.0
Sprache
EN

Vorschau

Usage:

Minimize any YouTube video you want from safari or YouTube application.

Neue Funktionen

Version 1.0

First release

Versionsverlauf
1.0 25. Mär 2021

First release

Was er macht

49 Aktionen
  1. Comment
    Author: Ari R. Abdulla Usage: Minimize any YouTube video you want.
  2. If
  3. Get Type
  4. Set Variable
    Shortcut Type
  5. If
  6. Text
  7. If
  8. Run JavaScript on Web Page
  9. Stop This Shortcut
  10. If
  11. Show Alert
  12. Stop This Shortcut
  13. If
  14. Text
  15. Set Variable
    Shortcut Text
  16. If
  17. Set Variable
    Shortcut Input
  18. Nothing
  19. If
  20. Show Alert
  21. Stop This Shortcut
  22. If
  23. Get Clipboard
  24. If
  25. Set Variable
    Shortcut Input
  26. Nothing
  27. If
  28. If
  29. Set Variable
    Shortcut Input
  30. Nothing
  31. If
  32. Show Alert
  33. Stop This Shortcut
  34. URL
    …
  35. Set Variable
    Link
  36. If
  37. Nothing
  38. If
  39. Replace Text
  40. Set Variable
    Link
  41. Text
  42. Run Script Inline
    dk.simonbs.Scriptable
  43. Get Dictionary from Input
  44. Get Dictionary Value
  45. Set Variable
    FinalURL
  46. Open URLs
  47. Wait
  48. Open App
  49. Stop This Shortcut

Als Code ansehen
Beta

Jede Aktion dieses Kurzbefehls als Cherri ausgeschrieben, eine Programmiersprache für Kurzbefehle. Ideal, um zu lernen, wie er funktioniert.

#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()
In Cherri Playground öffnen Mit cherri 2.3.0 (GPL-2.0) dekompiliert. Eventuell sind kleine Korrekturen nötig, bevor es kompiliert wird.

Bewertungen und Rezensionen

Rezension schreiben
–
von 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Werbung

Mehr von arirafiq

Alle anzeigen

Das gefällt dir vielleicht auch

Alle anzeigen
Werbung