ShareShortcuts

uTube PiP

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

arirafiq
Fork “uTube PiP”

Har du bygget noget nyt oven på denne genvej? Del den som en fork: den bliver din egen genvej, som du styrer, og begge sider linker til hinanden, så arirafiq får kredit.

  1. 1Hent genvejen og ret den i Genveje-appen. Giv den sit eget navn.
  2. 2Del den fra Genveje-appen og kopiér iCloud-linket.
  3. 3Kom tilbage hertil, indsæt linket og beskriv, hvad der er anderledes, fx “Tilføjet et trin, der bruger Apple Intelligence til at gøre teksten mere personlig.”
Downloads
57K
Gemt
2
Handlinger
49
Kategori
Streaming
Version
1.0
Sprog
EN

Forhåndsvisning

Usage:

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

Nyheder

Version 1.0

First release

Versionshistorik
1.0 25. mar. 2021

First release

Hvad den gør

49 handlinger
  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

Vis som kode
Beta

Alle genvejens handlinger skrevet ud i Cherri, et programmeringssprog til genveje. Perfekt til at lære, hvordan den virker.

#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()
Åbn i Cherri Playground Dekompileret med cherri 2.3.0 (GPL-2.0). Kan kræve små rettelser, før den kan kompileres.

Bedømmelser og anmeldelser

Skriv en anmeldelse
–
ud af 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Ingen anmeldelser endnu. Vær den første!

Annonce

Mere fra arirafiq

Se alle

Du vil måske også kunne lide

Se alle
Annonce