CouchPotato Script Injector

Injects the CouchPotato automation script on IMDB movie pages

  1. // ==UserScript==
  2. // @name CouchPotato Script Injector
  3. // @namespace http://www.tampermonkey.net
  4. // @version 0.1
  5. // @description Injects the CouchPotato automation script on IMDB movie pages
  6. // @author GCandez
  7. // @match http://www.imdb.com/title/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. //CONFIGURATION
  12.  
  13.  
  14. var apiAdress = ''; //The adress for the CouchPotato API (e.g. http://localhost:8080/api)
  15. var apiKey = ''; //The key for the CouchPotato API
  16.  
  17.  
  18. (function(){
  19. //CHECK IF CURRENT PAGE IS MOVIE PAGE
  20. var element = document.querySelector('meta[property="og:type"]');
  21. var content = element && element.getAttribute("content");
  22. var isMovie = content == "video.movie";
  23. if(!isMovie){
  24. return;
  25. }
  26. //IS MOVIE, INJECT SCRIPT
  27. var apiAdressAndKey = apiAdress + '/' + apiKey;
  28. var script = document.createElement('script');
  29. script.type = 'text/javascript';
  30. script.src = apiAdressAndKey + '/userscript.bookmark/?host=' + apiAdressAndKey + '/userscript.get/5ssselO1/&r=' + Math.random() * 99999999;
  31.  
  32. document.body.appendChild(script);
  33. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址