ShareShortcuts

uTube PiP

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

arirafiq
Bifurcar “uTube PiP”

¿Creaste algo nuevo a partir de este atajo? Compártelo como bifurcación: se convierte en un atajo tuyo, que tú administras, y ambas páginas se enlazan entre sí para que arirafiq reciba el crédito.

  1. 1Obtén el atajo y modifícalo en la app Atajos. Ponle un nombre propio.
  2. 2Compártelo desde la app Atajos y copia el enlace de iCloud.
  3. 3Vuelve aquí, pega el enlace y describe qué es diferente, p. ej., “Se añadió un paso que usa Apple Intelligence para personalizar el texto”.
Descargas
57K
Guardado
2
Acciones
49
Categoría
Streaming
Versión
1.0
Idioma
EN

Vista previa

Usage:

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

Novedades

Versión 1.0

First release

Historial de versiones
1.0 25 de mar. de 2021

First release

Qué hace

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

Ver como código
Beta

Todas las acciones de este atajo escritas en Cherri, un lenguaje de programación para Atajos. Ideal para aprender cómo funciona.

#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()
Abrir en Cherri Playground Descompilado con cherri 2.3.0 (GPL-2.0). Puede que necesite pequeños ajustes antes de compilarse.

Valoraciones y reseñas

Escribe una reseña
–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aún no hay reseñas. ¡Sé el primero en compartir tu opinión!

Publicidad

Más de arirafiq

Ver todo

También te puede gustar

Ver todo
Publicidad