sebbu

jd/plugins/decrypter/JavCL.java

Jul 1st, 2018 (edited)
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.55 KB | None | 0 0
  1. package jd.plugins.decrypter;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Base64;
  5.  
  6. import jd.PluginWrapper;
  7. import jd.controlling.ProgressController;
  8. import jd.controlling.linkcrawler.CrawledLink;
  9. import jd.parser.Regex;
  10. import jd.plugins.CryptedLink;
  11. import jd.plugins.DecrypterPlugin;
  12. import jd.plugins.DownloadLink;
  13. import jd.plugins.PluginForDecrypt;
  14.  
  15. @DecrypterPlugin(revision = "$Revision: 36558 $", interfaceVersion = 2, names = { "javcl.com" }, urls = { "https?://(?:www\\.)?javcl\\.com/([^/]+)/" })
  16. public class JavCL extends PluginForDecrypt {
  17.     public JavCL(PluginWrapper wrapper) {
  18.         super(wrapper);
  19.     }
  20.  
  21.     @Override
  22.     public ArrayList<DownloadLink> decryptIt(CryptedLink parameter, ProgressController progress) throws Exception {
  23.         final ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
  24.         br.getPage(parameter.getCryptedUrl());
  25.         String filename = br.getRegex("<span class=\"title2\">([a-zA-Z0-9-]+)</span>").getMatch(0);
  26.         String data_id = br.getRegex("<div id='videoPlayer' data-id=\"([0-9]+)\" data-ep=\"([0-9]+)\">").getMatch(0);
  27.         Regex data_links = br.getRegex("<li data-sv=\"([0-9]+)\" data-link=\"([a-zA-Z0-9/+=-]+)\"(?: class=\"active\")?>\\s*([^</]+)\\s*</li>");
  28.         int index = 0;
  29.         for (String data_link : data_links.getColumn(1)) {
  30.             String _link = decodejav(data_link, data_id);
  31.             CryptedLink _link2 = new CryptedLink(_link);
  32.             jd.plugins.decrypter.FEmbedDecrypter plugin = new jd.plugins.decrypter.FEmbedDecrypter(getLazyC().getPluginWrapper());
  33.             plugin.setBrowser(br);
  34.             if (data_links.count() > 1) {
  35.                 plugin.setFilename(filename + "_" + (char) ('a' + index));
  36.             } else {
  37.                 plugin.setFilename(filename);
  38.             }
  39.             ArrayList<DownloadLink> ret2 = plugin.decryptIt(new CrawledLink(_link2));
  40.             ret.addAll(ret2);
  41.             index++;
  42.         }
  43.         return ret;
  44.     }
  45.  
  46.     public String decodejav(String data_link, String data_id) {
  47.         String key = Base64.getEncoder().encodeToString((data_id + "decodejav").getBytes());
  48.         key = new StringBuilder(key).reverse().toString();
  49.         byte[] link = Base64.getDecoder().decode(data_link);
  50.         StringBuilder sb = new StringBuilder();
  51.         int k = 0;
  52.         for (int i = 0; i < link.length; i++) {
  53.             k = i % key.length();
  54.             sb.append((char) (link[i] ^ key.codePointAt(k)));
  55.         }
  56.         return new String(Base64.getDecoder().decode(sb.toString()));
  57.     }
  58. }
Add Comment
Please, Sign In to add comment