Skip to content

Instantly share code, notes, and snippets.

@MrCirdo
Created August 24, 2016 15:16
Show Gist options
  • Save MrCirdo/171f1cecf6979c086ba82920006f7229 to your computer and use it in GitHub Desktop.
Save MrCirdo/171f1cecf6979c086ba82920006f7229 to your computer and use it in GitHub Desktop.
Parfois c'est chiant car les vidéos hébergées par OpenLoad ne se mettent pas en plein écran, du coup la seule solution que j'ai trouvé est d'ouvrir l'url de la vidéo. Mais ça aussi c'est chiant, il faut inspecter l'élément, etc... Du coup ce script sert à extraire les vidéos OpenLoad du html et à les ouvrir.
tell application "Safari"
set urlOpenLoad to do JavaScript "var src = ''
for (var i = 0; i < document.getElementsByTagName('iframe').length; i++){
if (document.getElementsByTagName('iframe')[i]['src'].indexOf('openload') != -1){
src = document.getElementsByTagName('iframe')[i]['src'];
}
}
" in first document
if urlOpenLoad is "" or urlOpenLoad does not contain "http" then
display alert "Il y'a pas vidéo openLoad sur cette page" as warning
else
open location urlOpenLoad
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment