ShareShortcuts

uTube PiP

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

arirafiq
Fazer fork de “uTube PiP”

Criou algo novo a partir deste atalho? Compartilhe como uma derivação: ela se torna um atalho seu, que você gerencia, e as duas páginas têm links entre si para que arirafiq receba o crédito.

  1. 1Obtenha o atalho e altere-o no app Atalhos. Dê a ele um nome próprio.
  2. 2Compartilhe pelo app Atalhos e copie o link do iCloud.
  3. 3Volte aqui, cole o link e descreva o que mudou, por exemplo: “Adicionei uma etapa que usa a Apple Intelligence para personalizar o texto.”
Downloads
57K
Salvo
2
Ações
49
Categoria
Streaming
Versão
1.0
Idioma
EN

Pré-visualização

Usage:

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

Novidades

Versão 1.0

First release

Histórico de versões
1.0 25 de mar de 2021

First release

O que ele faz

49 ações
  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 as ações deste atalho escritas em Cherri, uma linguagem de programação para o app Atalhos. Ótimo para aprender como ele 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 no Cherri Playground Descompilado com cherri 2.3.0 (GPL-2.0). Pode precisar de pequenos ajustes antes de compilar.

Avaliações e comentários

Escrever uma avaliação
–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Ainda não há avaliações. Seja o primeiro a compartilhar o que você pensa!

Publicidade

Mais de arirafiq

Ver tudo

Você também pode gostar

Ver tudo
Publicidade