-added support for uploadlux.com (+premium) closes #6623

-improved yuvutu errorhandling fixes #6625
-improved yourfilelink errorhandling fixes #6626
-improved googlevideo errorhandling fixes #6627
-improved xxxaporn fixes #6634
-maybe fixed youporndeutsch for Stable, check after next updates refs #6628
-improved zalaa errorhandling fixes #6635
-ovfile.com: RIP fixes #6636
-improved archieve fixes #6637
-added errorhandling for the decrypterforredirectserviceswithoutdirectredirects decrypter fixes #6639
-refs #6632
-added support for flazhshare but not for premium is there is no user and pass given closes #6640
-improved tutv regex
-set new flyfiles limits
-added support for another rghost linktype
-fixed prefiles
-added support to grab all tumblr posts from a user
-added support for venusfile (+free account)
-added support for blitzfiles (+free account)
-added exclusivefaile free account support
-savefile.ro: RIP
-bebasupload.com: RIP
-fileserver.cc: RIP
-uploadville.com: RIP

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@18671 ebf7c1c2-ba36-0410-9fe8-c592906822b4
This commit is contained in:
psp 2012-10-08 23:48:38 +00:00
parent 89f06fa136
commit c3d24384fd
32 changed files with 2713 additions and 2132 deletions

View File

@ -1,4 +1,4 @@
<jDownloader>
<method name="xfilesharingpro" author="ManiacMansion" services="savefile.ro;midupload.com;bebasupload.com;fileplayground.com;putshare.com;uploadville.com;downupload.com;uploadic.com;xfilesharingprobasic"/>
<method name="xfilesharingpro" author="ManiacMansion" services="midupload.com;fileplayground.com;putshare.com;downupload.com;uploadic.com;xfilesharingprobasic"/>
<format type="jpg" letterNum="4"></format>
</jDownloader>

View File

@ -949,4 +949,8 @@ jd/plugins/hoster/FarShareTo.class
jd/plugins/hoster/EyVxCom.class
jd/plugins/hoster/DudUploadCom.class
jd/plugins/hoster/GptFileCom.class
jd/plugins/hoster/DivxBaseCom.class
jd/plugins/hoster/DivxBaseCom.class
jd/plugins/hoster/OvFileCom.class
jd/plugins/hoster/SavefileRo.class
jd/plugins/hoster/BebasUploadCom.class
jd/plugins/hoster/UploadVilleCom.class

View File

@ -27,7 +27,7 @@ import jd.plugins.DownloadLink;
import jd.plugins.FilePackage;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "archive.org" }, urls = { "http://(www\\.)?archive\\.org/details/[A-Za-z0-9_\\-\\.]+" }, flags = { 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "archive.org" }, urls = { "http://(www\\.)?archive\\.org/details/(?!copyrightrecords)[A-Za-z0-9_\\-\\.]+" }, flags = { 0 })
public class ArchieveOrg extends PluginForDecrypt {
public ArchieveOrg(PluginWrapper wrapper) {
@ -38,9 +38,19 @@ public class ArchieveOrg extends PluginForDecrypt {
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
String parameter = param.toString().replace("://www.", "://");
br.getPage(parameter);
if (br.containsHTML(">Item cannot be found\\.<")) return decryptedLinks;
String[] links = br.getRegex("\"(/download/.*?/.*?)\"").getColumn(0);
if (links == null || links.length == 0) return null;
if (br.containsHTML(">The item is not available")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
if (!br.containsHTML("/download/")) {
logger.info("Maybe invalid link: " + parameter);
return decryptedLinks;
}
final String[] links = br.getRegex("\"(/download/.*?/.*?)\"").getColumn(0);
if (links == null || links.length == 0) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
for (String singleLink : links) {
decryptedLinks.add(createDownloadlink("directhttp://http://archive.org" + singleLink));
}

View File

@ -41,16 +41,16 @@ import jd.plugins.Plugin;
import jd.plugins.PluginForDecrypt;
import jd.utils.locale.JDL;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "handsupbr.com", "mkv2.info", "searchonzippy.eu", "sharmota.com", "adcrun.ch", "allsubs.org", "egcenter.com", "komp3.net", "url.bilgiportal.com", "tinymoviez.info", "getunite.com", "hflix.in", "focus.de", "hnzoom.com", "basemp3.ru", "stream2k.eu", "share-films.net", "leechmf.com", "protetorbr.com", "adv.li", "lezlezlez.com", "dwz.cn", "online.nolife-tv.com", "digitaldripped.com", "guardlink.org", "url.cn", "q32.ru", "shrk.biz", "icefilms.info", "gabber.od.ua", "mediaboom.org", "vimeo.com", "unlimfiles.com", "adfoc.us", "mrbrownee70.com", "alturl.com", "trancearoundtheworld.com", "egfire.net", "damasgate.com", "freeonsmash.com", "lnk.co", "trackstash.com", "fburls.com", "myurl.in", "h-url.in", "dropbox.com", "1-star.net", "protect-ddl.com", "filep.info", "grou.ps", "linkexterno.com", "eskimotube.com",
"m4u.in", "4p5.com", "t.co", "telona.biz", "madmimi.com", "href.hu", "hide.linkleak.org", "migre.me", "degracaemaisgostoso.info", "altervista.org", "agaleradodownload.com", "musicloud.fm", "wowebook.be", "link.songs.pk + songspk.info", "imageto.net", "clubteam.eu", "jforum.uni.cc", "linksole.com", "deurl.me", "yourfileplace.com", "muzgruz.ru", "zero10.net", "aiotool.net", "chip.de/c1_videos", "multiprotect.info", "nbanews.us", "top2tech.com", "umquetenha.org", "oneclickmoviez.com/dwnl/", "1tool.biz", "trailerzone.info", "file4ever.us and catchfile.net", "zero10.net and gamz.us", "official.fm", "hypem.com", "academicearth.org", "skreemr.org", "tm-exchange.com", "adiarimore.com", "mafia.to/download", "bogatube.com", "newgrounds.com", "accuratefiles.com", "slutdrive.com", "view.stern.de", "fileblip.com", "warcraft.ingame.de", "mixconnect.com", "twiturm.com",
"ebooksdownloadfree.com", "freebooksearcher.info", "ubuntuone.com", "mp3.wp.pl", "gantrack.com" }, urls = { "http://(www\\.)?handsupbr\\.com/play/\\d+/", "http://(www\\.)?mkv2\\.info/s/[a-z0-9]+", "http://(www\\.)?searchonzippy\\.eu/out\\.php\\?link=\\d+", "http://(www\\.)?sharmota\\.com/movies/\\d+/\\d+", "http://(www\\.)?adcrun\\.ch/\\w+", "http://(www\\.)?allsubs\\.org/subs\\-download/[a-z0-9\\-_]+/\\d+/", "http://(www\\.)?egcenter\\.com/\\d+", "http://(www\\.)?komp3\\.net/download/mp3/\\d+/[^<>\"]+\\.html", "http://(www\\.)?url\\.bilgiportal\\.com/[0-9]+", "http://(www\\.)?tinymoviez\\.info/download\\.php\\?link=[A-Za-z0-9]+", "http://(www\\.)?getunite\\.com/\\?d=\\d+\\.\\d+\\.\\d+\\.\\d+/[a-z0-9]+/[a-z0-9]+/", "http://(www\\.)?hflix\\.in/[A-Za-z0-9]+", "http://(www\\.)?focus\\.de/[a-zA-Z]+/(videos|internet/[a-zA-Z]+)/[\\w\\-]+\\.html",
"http://(www\\.)?hnzoom.com/\\?[A-Za-z0-9]{20}", "http://(www\\.)?basemp3\\.ru/music\\-view\\-\\d+\\.html", "http://(www\\.)?stream2k\\.eu/video/\\d+", "http://(www\\.)?share\\-films\\.net/redirect\\.php\\?url=[a-z0-9]+", "http://(www\\.)?leechmf\\.com/\\?[A-Za-z0-9]+", "http://(www\\.)?protetorbr\\.com/d\\?id=\\d+", "http://(www\\.)?adv\\.li/[A-Za-z0-9]+", "http://(www\\.)?lezlezlez\\.com/mediaswf\\.php\\?type=vid\\&name=[^<>\"/]+\\.flv", "http://(www\\.)?dwz\\.cn/[A-Za-z0-9]+", "http://(www\\.)?online\\.nolife\\-tv\\.com/index\\.php\\?id=\\d+", "http://(www\\.)?digitaldripped\\.com/(?!/ajax|js/)[^<>\"\\']+", "http://(www\\.)?guardlink\\.org/[A-Za-z0-9]+", "http://url\\.cn/[0-9a-zA-Z]+", "http://q32\\.ru/\\d+/c/[A-Za-z0-9\\-_]+", "http://(de\\.)?shrk\\.biz/\\w+", "http://(www\\.)?icefilms\\.info/ip\\.php\\?v=\\d+\\&?", "http://(www\\.)?gabber\\.od\\.ua/g/\\?[^/<>\"]+",
"http://(www\\.)?vimeo\\.com/(?!(\\d+/|tag|search)).*?/.+", "http://(www\\.)?unlimfiles\\.com/sourceframe/.+", "http://(www\\.)?adfoc\\.us/(serve/\\?id=[a-z0-9]+|[a-z0-9]+)", "http://(www\\.)?mrbrownee70\\.com/\\?id=[A-Za-z0-9]+", "http://[\\w\\.]*?alturl\\.com/[a-z0-9]+", "http://(www\\.)?trancearoundtheworld\\.com/tatw/\\d+", "http://(www\\.)?egfire\\.net/\\d+", "http://(www\\.)?damasgate\\.com/redirector\\.php\\?url=.+", "http://(www\\.)?freeonsmash\\.com/redir/[A-Za-z0-9\\=\\+\\/\\.\\-]+", "http://(www\\.)?lnk\\.co/[A-Za-z0-9]+", "http://(www\\.)?trackstash\\.com/tracks/[a-z0-9\\-]+", "http://(www\\.)?fburls\\.com/\\d+\\-[A-Za-z0-9]+", "http://(www\\.)?protect\\.myurl\\.in/[A-Za-z0-9]+", "http://(www\\.)?h\\-url\\.in/[A-Za-z0-9]+", "https://(www\\.)?dropbox\\.com/s/[a-z0-9]+/.+",
"http://(www\\.)?(1lien\\.com/(download/)?\\d+/|1\\-star\\.net/\\d+/\\d+/|stardima\\.com(/anime)?/download/\\d+/)", "http://(www\\.)?protect-ddl\\.com/[a-fA-F0-oneclickmoviez9]+", "http://(www\\.)?filep\\.info/(\\?url=|/)\\d+", "http://(www\\.)?grou\\.ps/[a-z0-9]+/videos/\\d+", "http://(www\\.)?linkexterno\\.com/[A-Za-z0-9]+", "http://(www\\.)?eskimotube\\.com/\\d+\\-.*?\\.html", "http://(www\\.)?m4u\\.in/[a-z0-9]+", "http://(www\\.)?4p5\\.com/[a-z0-9]+", "http://t\\.co/[a-zA-Z0-9]+", "http://[\\w\\.]*?telona\\.biz/protec?tor.*?\\?.*?//:ptth", "http://go\\.madmimi\\.com/redirects/[a-zA-Z0-9]+\\?pa=\\d+", "http://href\\.hu/x/[a-zA-Z0-9\\.]+", "http://hide\\.linkleak\\.org/[a-zA-Z0-9\\.]+", "http://[\\w\\.]*?migre\\.me/[a-z0-9A-Z]+", "http://[\\w\\.]*?degracaemaisgostoso\\.(biz|info)/download/\\?url=.*?:ptth", "http://[\\w\\.]*?altervista\\.org/\\?i=[0-9a-zA-Z]+",
"http://[\\w\\.]*?agaleradodownload\\.com/download.*?\\?.*?//:ptth", "http://[\\w\\.]*?musicloud\\.fm/dl/[A-Za-z0-9]+", "http://(www\\.)?wowebook\\.be/download/\\d+", "http://[\\w\\.]*?(link\\.songs\\.pk/(popsong|song1|bhangra)\\.php\\?songid=|songspk\\.info/ghazals/download/ghazals\\.php\\?id=)[0-9]+", "http://[\\w\\.]*?imageto\\.net/(\\?v=|images/)[0-9a-z]+\\..{2,4}", "http://[\\w\\.]*?clubteam\\.eu/dl\\.php\\?id=\\d\\&c=[a-zA-z0-9=]+", "http://[\\w\\.]*?jforum\\.uni\\.cc/protect/\\?r=[a-z0-9]+", "http://[\\w\\.]*?linksole\\.com/[0-9a-z]+", "http://[\\w\\.]*?deurl\\.me/[0-9A-Z]+", "http://(www\\.)?(yourfileplace|megafilegarden)\\.com/d/\\d+/.+", "http://[\\w\\.]*?muzgruz\\.ru/music/download/\\d+", "http://[\\w\\.]*?zero10\\.net/\\d+", "http://[\\w\\.]*?aiotool\\.net/\\d+", "http://[\\w\\.]*?chip\\.de/c1_videos/.*?-Video_\\d+\\.html", "http://(www\\.)?multiprotect\\.info/\\d+",
"http://[\\w\\.]*?nbanews\\.us/\\d+", "http://[\\w\\.]*?top2tech\\.com/\\d+", "http://(www\\.)?umquetenha\\.org/protecao/resolve\\.php\\?link=.+", "http://(www\\.)?oneclickmoviez\\.com/[a-z]{1,8}/[A-Z0-9\\-_]+/\\d+/\\d+", "http://(www\\.)?1tool\\.biz/\\d+", "http://(www\\.)?trailerzone\\.info/(protect|wait(2)?)\\.(php\\?|html)(key=|u=|#:{1,})[a-zA-Z0-9=+/]+", "http://[\\w\\.]*?(file4ever\\.us|catchfile\\.net)/\\d+", "http://[\\w\\.]*?(zero10\\.net/|gamz\\.us/\\?id=)\\d+", "http://(www\\.)?official\\.fm/track(s)?/\\d+", "http://(www\\.)?hypem\\.com/(track/\\d+/|item/[a-z0-9]+)", "http://[\\w\\.]*?academicearth\\.org/lectures/.+", "http://[\\w\\.]*?skreemr\\.org/link\\.jsp\\?id=[A-Z0-9]+", "http://[\\w\\.]*?tm-exchange\\.com/(get\\.aspx\\?action=trackgbx|\\?action=trackshow)\\&id=\\d+", "http://[\\w\\.]*?adiarimore\\.com/miralink/[a-z0-9]+",
"http://[\\w\\.]*?mafia\\.to/download-[a-z0-9]+\\.cfm", "http://[\\w\\.]*?bogatube\\.com/tube/\\d+/\\d+/.*?\\.php", "http://[\\w\\.]*?newgrounds\\.com/(portal/view/|audio/listen/)\\d+", "http://(www\\.)?accuratefiles\\.com/fileinfo/[a-z0-9]+", "http://(www\\.)?slutdrive\\.com/video-\\d+\\.html", "http://(www\\.)?view\\.stern\\.de/de/(picture|original)/.*?-\\d+\\.html", "http://(www\\.)?fileblip\\.com/[a-z0-9]+", "http://(www\\.)?warcraft\\.ingame\\.de/downloads/\\?file=\\d+", "http://(www\\.)?mixconnect\\.com/listen/.*?-mid\\d+", "http://(www\\.)?twiturm\\.com/[a-z0-9]+", "http://(www\\.)?ebooksdownloadfree\\.com/.*?/.*?\\.html", "http://(www\\.)?freebooksearcher\\.info/downloadbook\\.php\\?id=\\d+", "http://(www\\.)?ubuntuone\\.com/p/[A-Za-z0-9]+", "http://[\\w\\.]*?mp3\\.wp\\.pl/(?!ftp)(p/strefa/artysta/\\d+,utwor,\\d+\\.html|\\?tg=[A-Za-z0-9=]+)",
"http://(www\\.)?gantrack\\.com/t/l/\\d+/[A-Za-z0-9]+", "http://(www\\.)?mediaboom\\.org/engine/go\\.php\\?url=.+" }, flags = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "handsupbr.com", "mkv2.info", "searchonzippy.eu", "sharmota.com", "adcrun.ch", "allsubs.org", "egcenter.com", "komp3.net", "url.bilgiportal.com", "tinymoviez.info", "getunite.com", "hflix.in", "focus.de", "hnzoom.com", "basemp3.ru", "stream2k.eu", "share-films.net", "leechmf.com", "protetorbr.com", "adv.li", "lezlezlez.com", "dwz.cn", "online.nolife-tv.com", "digitaldripped.com", "guardlink.org", "url.cn", "q32.ru", "shrk.biz", "icefilms.info", "mediaboom.org", "vimeo.com", "unlimfiles.com", "adfoc.us", "mrbrownee70.com", "alturl.com", "trancearoundtheworld.com", "egfire.net", "damasgate.com", "freeonsmash.com", "lnk.co", "trackstash.com", "fburls.com", "myurl.in", "h-url.in", "dropbox.com", "1-star.net", "filep.info", "grou.ps", "linkexterno.com", "eskimotube.com", "m4u.in", "4p5.com", "t.co",
"telona.biz", "madmimi.com", "href.hu", "hide.linkleak.org", "migre.me", "degracaemaisgostoso.info", "altervista.org", "agaleradodownload.com", "musicloud.fm", "wowebook.be", "link.songs.pk + songspk.info", "imageto.net", "clubteam.eu", "jforum.uni.cc", "linksole.com", "deurl.me", "yourfileplace.com", "muzgruz.ru", "zero10.net", "aiotool.net", "chip.de/c1_videos", "multiprotect.info", "nbanews.us", "top2tech.com", "umquetenha.org", "oneclickmoviez.com/dwnl/", "1tool.biz", "trailerzone.info", "file4ever.us and catchfile.net", "zero10.net and gamz.us", "official.fm", "hypem.com", "academicearth.org", "skreemr.org", "tm-exchange.com", "adiarimore.com", "mafia.to/download", "bogatube.com", "newgrounds.com", "accuratefiles.com", "slutdrive.com", "view.stern.de", "fileblip.com", "warcraft.ingame.de", "mixconnect.com", "twiturm.com", "ebooksdownloadfree.com", "freebooksearcher.info",
"ubuntuone.com", "mp3.wp.pl", "gantrack.com" }, urls = { "http://(www\\.)?handsupbr\\.com/play/\\d+/", "http://(www\\.)?mkv2\\.info/s/[a-z0-9]+", "http://(www\\.)?searchonzippy\\.eu/out\\.php\\?link=\\d+", "http://(www\\.)?sharmota\\.com/movies/\\d+/\\d+", "http://(www\\.)?adcrun\\.ch/\\w+", "http://(www\\.)?allsubs\\.org/subs\\-download/[a-z0-9\\-_]+/\\d+/", "http://(www\\.)?egcenter\\.com/\\d+", "http://(www\\.)?komp3\\.net/download/mp3/\\d+/[^<>\"]+\\.html", "http://(www\\.)?url\\.bilgiportal\\.com/[0-9]+", "http://(www\\.)?tinymoviez\\.info/download\\.php\\?link=[A-Za-z0-9]+", "http://(www\\.)?getunite\\.com/\\?d=\\d+\\.\\d+\\.\\d+\\.\\d+/[a-z0-9]+/[a-z0-9]+/", "http://(www\\.)?hflix\\.in/[A-Za-z0-9]+", "http://(www\\.)?focus\\.de/[a-zA-Z]+/(videos|internet/[a-zA-Z]+)/[\\w\\-]+\\.html", "http://(www\\.)?hnzoom.com/\\?[A-Za-z0-9]{20}",
"http://(www\\.)?basemp3\\.ru/music\\-view\\-\\d+\\.html", "http://(www\\.)?stream2k\\.eu/video/\\d+", "http://(www\\.)?share\\-films\\.net/redirect\\.php\\?url=[a-z0-9]+", "http://(www\\.)?leechmf\\.com/\\?[A-Za-z0-9]+", "http://(www\\.)?protetorbr\\.com/d\\?id=\\d+", "http://(www\\.)?adv\\.li/[A-Za-z0-9]+", "http://(www\\.)?lezlezlez\\.com/mediaswf\\.php\\?type=vid\\&name=[^<>\"/]+\\.flv", "http://(www\\.)?dwz\\.cn/[A-Za-z0-9]+", "http://(www\\.)?online\\.nolife\\-tv\\.com/index\\.php\\?id=\\d+", "http://(www\\.)?digitaldripped\\.com/(?!/ajax|js/)[^<>\"\\']{2,}", "http://(www\\.)?guardlink\\.org/[A-Za-z0-9]+", "http://url\\.cn/[0-9a-zA-Z]+", "http://q32\\.ru/\\d+/c/[A-Za-z0-9\\-_]+", "http://(de\\.)?shrk\\.biz/\\w+", "http://(www\\.)?icefilms\\.info/ip\\.php\\?v=\\d+\\&?", "http://(www\\.)?vimeo\\.com/(?!(\\d+/|tag|search)).*?/.+",
"http://(www\\.)?unlimfiles\\.com/sourceframe/.{2,}", "http://(www\\.)?adfoc\\.us/(serve/\\?id=[a-z0-9]+|(?!serve)[a-z0-9]+)", "http://(www\\.)?mrbrownee70\\.com/\\?id=[A-Za-z0-9]+", "http://[\\w\\.]*?alturl\\.com/[a-z0-9]+", "http://(www\\.)?trancearoundtheworld\\.com/tatw/\\d+", "http://(www\\.)?egfire\\.net/\\d+", "http://(www\\.)?damasgate\\.com/redirector\\.php\\?url=.+", "http://(www\\.)?freeonsmash\\.com/redir/[A-Za-z0-9\\=\\+\\/\\.\\-]+", "http://(www\\.)?lnk\\.co/[A-Za-z0-9]+", "http://(www\\.)?trackstash\\.com/tracks/[a-z0-9\\-]+", "http://(www\\.)?fburls\\.com/\\d+\\-[A-Za-z0-9]+", "http://(www\\.)?protect\\.myurl\\.in/[A-Za-z0-9]+", "http://(www\\.)?h\\-url\\.in/[A-Za-z0-9]+", "https://(www\\.)?dropbox\\.com/s/[a-z0-9]+/.+", "http://(www\\.)?(1lien\\.com/(download/)?\\d+/|1\\-star\\.net/\\d+/\\d+/|stardima\\.com(/anime)?/download/\\d+/)",
"http://(www\\.)?filep\\.info/(\\?url=|/)\\d+", "http://(www\\.)?grou\\.ps/[a-z0-9]+/videos/\\d+", "http://(www\\.)?linkexterno\\.com/[A-Za-z0-9]+", "http://(www\\.)?eskimotube\\.com/\\d+\\-.*?\\.html", "http://(www\\.)?m4u\\.in/[a-z0-9]+", "http://(www\\.)?4p5\\.com/[a-z0-9]+", "http://t\\.co/[a-zA-Z0-9]+", "http://[\\w\\.]*?telona\\.biz/protec?tor.*?\\?.*?//:ptth", "http://go\\.madmimi\\.com/redirects/[a-zA-Z0-9]+\\?pa=\\d+", "http://href\\.hu/x/[a-zA-Z0-9\\.]+", "http://hide\\.linkleak\\.org/[a-zA-Z0-9\\.]+", "http://[\\w\\.]*?migre\\.me/[a-z0-9A-Z]+", "http://[\\w\\.]*?degracaemaisgostoso\\.(biz|info)/download/\\?url=.*?:ptth", "http://[\\w\\.]*?altervista\\.org/\\?i=[0-9a-zA-Z]+", "http://[\\w\\.]*?agaleradodownload\\.com/download.*?\\?.*?//:ptth", "http://[\\w\\.]*?musicloud\\.fm/dl/[A-Za-z0-9]+", "http://(www\\.)?wowebook\\.be/download/\\d+",
"http://[\\w\\.]*?(link\\.songs\\.pk/(popsong|song1|bhangra)\\.php\\?songid=|songspk\\.info/ghazals/download/ghazals\\.php\\?id=)[0-9]+", "http://[\\w\\.]*?imageto\\.net/(\\?v=|images/)[0-9a-z]+\\..{2,4}", "http://[\\w\\.]*?clubteam\\.eu/dl\\.php\\?id=\\d\\&c=[a-zA-z0-9=]+", "http://[\\w\\.]*?jforum\\.uni\\.cc/protect/\\?r=[a-z0-9]+", "http://[\\w\\.]*?linksole\\.com/[0-9a-z]+", "http://[\\w\\.]*?deurl\\.me/[0-9A-Z]+", "http://(www\\.)?(yourfileplace|megafilegarden)\\.com/d/\\d+/.+", "http://[\\w\\.]*?muzgruz\\.ru/music/download/\\d+", "http://[\\w\\.]*?zero10\\.net/\\d+", "http://[\\w\\.]*?aiotool\\.net/\\d+", "http://[\\w\\.]*?chip\\.de/c1_videos/.*?-Video_\\d+\\.html", "http://(www\\.)?multiprotect\\.info/\\d+", "http://[\\w\\.]*?nbanews\\.us/\\d+", "http://[\\w\\.]*?top2tech\\.com/\\d+", "http://(www\\.)?umquetenha\\.org/protecao/resolve\\.php\\?link=.{2,}",
"http://(www\\.)?oneclickmoviez\\.com/[a-z]{1,8}/[A-Z0-9\\-_]+/\\d+/\\d+", "http://(www\\.)?1tool\\.biz/\\d+", "http://(www\\.)?trailerzone\\.info/(protect|wait(2)?)\\.(php\\?|html)(key=|u=|#:{1,})[a-zA-Z0-9=+/]+", "http://[\\w\\.]*?(file4ever\\.us|catchfile\\.net)/\\d+", "http://[\\w\\.]*?(zero10\\.net/|gamz\\.us/\\?id=)\\d+", "http://(www\\.)?official\\.fm/track(s)?/\\d+", "http://(www\\.)?hypem\\.com/(track/\\d+/|item/[a-z0-9]+)", "http://[\\w\\.]*?academicearth\\.org/lectures/.{2,}", "http://[\\w\\.]*?skreemr\\.org/link\\.jsp\\?id=[A-Z0-9]+", "http://[\\w\\.]*?tm-exchange\\.com/(get\\.aspx\\?action=trackgbx|\\?action=trackshow)\\&id=\\d+", "http://[\\w\\.]*?adiarimore\\.com/miralink/[a-z0-9]+", "http://[\\w\\.]*?mafia\\.to/download-[a-z0-9]+\\.cfm", "http://[\\w\\.]*?bogatube\\.com/tube/\\d+/\\d+/.*?\\.php",
"http://[\\w\\.]*?newgrounds\\.com/(portal/view/|audio/listen/)\\d+", "http://(www\\.)?accuratefiles\\.com/fileinfo/[a-z0-9]+", "http://(www\\.)?slutdrive\\.com/video-\\d+\\.html", "http://(www\\.)?view\\.stern\\.de/de/(picture|original)/.*?-\\d+\\.html", "http://(www\\.)?fileblip\\.com/[a-z0-9]+", "http://(www\\.)?warcraft\\.ingame\\.de/downloads/\\?file=\\d+", "http://(www\\.)?mixconnect\\.com/listen/.*?-mid\\d+", "http://(www\\.)?twiturm\\.com/[a-z0-9]+", "http://(www\\.)?ebooksdownloadfree\\.com/.*?/.*?\\.html", "http://(www\\.)?freebooksearcher\\.info/downloadbook\\.php\\?id=\\d+", "http://(www\\.)?ubuntuone\\.com/p/[A-Za-z0-9]+", "http://[\\w\\.]*?mp3\\.wp\\.pl/(?!ftp)(p/strefa/artysta/\\d+,utwor,\\d+\\.html|\\?tg=[A-Za-z0-9=]+)", "http://(www\\.)?gantrack\\.com/t/l/\\d+/[A-Za-z0-9]+", "http://(www\\.)?mediaboom\\.org/engine/go\\.php\\?url=.+" }, flags = { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 })
public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginForDecrypt {
private final String NEWSREGEX2 = "<div id=\\'prep2\\' dir=\\'ltr\\' ><a href=\\'(.*?)\\'";
@ -66,6 +66,7 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
br.setFollowRedirects(false);
br.setReadTimeout(60 * 1000);
boolean dh = false;
boolean offline = false;
String finallink = null;
String finalfilename = null;
if (parameter.contains("vimeo.com")) {
@ -149,6 +150,7 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
finallink = br.getRegex("onclick=\"NewWindow\\('(.*?)','").getMatch(0);
} else if (parameter.contains("umquetenha.org/protecao/resolve.php?link=")) {
finallink = br.getRegex("http\\-equiv=\"refresh\" content=\"\\d+; url=(http.*?)\"").getMatch(0);
if (finallink == null && br.containsHTML("src=\"protecao\\.jpg\"")) offline = true;
} else if (parameter.contains("oneclickmoviez.com/")) {
final Regex allMatches = new Regex(parameter, "oneclickmoviez\\.com/[a-z]+/([A-Z0-9\\-_]+)/(\\d+)/(\\d+)");
final String host = allMatches.getMatch(0);
@ -246,6 +248,7 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
dh = true;
} else if (parameter.contains("academicearth.org/")) {
if (!(br.getRedirectLocation() != null && br.getRedirectLocation().contains("users/login"))) {
if (br.containsHTML(">Looks like the Internet may require a little disciplinary action")) offline = true;
finallink = br.getRegex("flashVars\\.flvURL = \"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = br.getRegex("<div><embed src=\"(.*?)\"").getMatch(0);
@ -359,6 +362,10 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
finalfilename += ".mp3";
}
} else if (parameter.contains("ebooksdownloadfree.com/")) {
if (br.containsHTML("the page you requested is not located here<")) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
finallink = br.getRegex("<strong>Link:</strong>\\&nbsp; </span><span class=\"linkcat\">[\t\n\r ]+<a style=\"font-size:16px\" href=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = br.getRegex("\"(http://freebooksearcher\\.info/downloadbook\\.php\\?id=\\d+)\"").getMatch(0);
@ -514,6 +521,7 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
}
} else if (parameter.contains("unlimfiles.com/")) {
finallink = br.getRegex("<iframe src=\"(.*?)\"").getMatch(0);
if (br.containsHTML("<iframe src=\"\">")) offline = true;
} else if (parameter.contains("mediaboom.org/")) {
finallink = Encoding.Base64Decode(new Regex(Encoding.htmlDecode(parameter), "mediaboom\\.org/engine/go\\.php\\?url=(.+)").getMatch(0));
} else if (parameter.contains("gabber.od.ua/")) {
@ -552,10 +560,7 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
finallink = Encoding.deepHtmlDecode(finallink).replace("&#114", "r");
}
} else if (parameter.contains("digitaldripped.com/")) {
if (br.containsHTML("http\\-equiv=\"refresh\">")) {
logger.info("Link offline/invalid: " + parameter);
return decryptedLinks;
}
if (br.containsHTML("http\\-equiv=\"refresh\">") || br.containsHTML(">404 Not Found<")) offline = true;
finallink = br.getRegex("<a class=\"download\\-btn\" target=\"[^<>\"\\']+\" href=\"(http://[^<>\"\\']+)\"").getMatch(0);
} else if (parameter.contains("online.nolife-tv.com/")) {
br.setFollowRedirects(true);
@ -738,6 +743,10 @@ public class DecrypterForRedirectServicesWithoutDirectRedirects extends PluginFo
br.postPage(parameter, "dl=1");
finallink = br.getRegex("Click on Download below to start the download</div>.*? <a href=\"(http[^<>\"]*?)\"").getMatch(0);
}
if (offline) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
if (finallink == null) {
logger.info("DecrypterForRedirectServicesWithoutDirectRedirects says \"Out of date\" for link: " + parameter);
return null;

View File

@ -33,7 +33,7 @@ import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "filesmonster.comDecrypt" }, urls = { "http://[\\w\\.\\d]*?filesmonster\\.com/(download.php\\?id=[A-Za-z0-9_-]+|dl/.*?/free/)" }, flags = { 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "filesmonster.comDecrypt" }, urls = { "http://(www\\.)?filesmonster\\.com/(download\\.php\\?id=[A-Za-z0-9_-]+|dl/.*?/free/)" }, flags = { 0 })
public class FilesMonsterDecrypter extends PluginForDecrypt {
public FilesMonsterDecrypter(PluginWrapper wrapper) {

View File

@ -37,26 +37,40 @@ public class RlGalleriesNt extends PluginForDecrypt {
}
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
final String parameter = param.toString();
ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
String parameter = param.toString();
br.setFollowRedirects(false);
br.setReadTimeout(3 * 60 * 1000);
br.setCookie(".urlgalleries.net", "popundr", "1");
br.getHeaders().put("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1");
br.getHeaders().put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
br.getHeaders().put("Accept-Language", "en-us,en;q=0.5");
br.getPage(parameter);
final String host = new Regex(parameter, "(http://(www\\.)?[a-z0-9]+\\.urlgalleries\\.net)").getMatch(0);
final String fpName = br.getRegex("border=\\'0\\' /></a></div>(.*?)</td></tr><tr>").getMatch(0);
final String[] links = br.getRegex("\\'(/image\\.php\\?cn=\\d+\\&uid=[A-Za-z0-9]+\\&where=.*?)\\'").getColumn(0);
if (links == null || links.length == 0) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
final String host = new Regex(parameter, "(http://(www\\.)?[a-z0-9]+\\.urlgalleries\\.net)").getMatch(0);
for (String aLink : links) {
int counter = 1;
final Browser brc = br.cloneBrowser();
for (final String aLink : links) {
try {
if (isAbort()) break;
} catch (final Throwable e) {
}
sleep(300, param);
Browser brc = br.cloneBrowser();
brc.getPage(host + aLink);
String finallink = brc.getRedirectLocation();
logger.info("Decrypting link " + counter + " of " + links.length);
sleep(new Random().nextInt(3) + 1000, param);
brc.getHeaders().put("Referer", "http://a4you.urlgalleries.net/blog_gallery.php?id=2983923&t=2&g=TLE+-+2010-12-28+-+Mathea+");
try {
brc.getPage(host + aLink);
} catch (final Exception e) {
logger.info("Link timed out: " + aLink);
counter++;
continue;
}
final String finallink = brc.getRedirectLocation();
if (finallink == null) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
@ -67,6 +81,7 @@ public class RlGalleriesNt extends PluginForDecrypt {
lol.setName(Integer.toString(new Random().nextInt(1000000000)));
decryptedLinks.add(lol);
logger.info(finallink);
counter++;
}
if (fpName != null) {
FilePackage fp = FilePackage.getInstance();

View File

@ -17,6 +17,7 @@
package jd.plugins.decrypter;
import java.util.ArrayList;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
@ -27,7 +28,7 @@ import jd.plugins.DownloadLink;
import jd.plugins.FilePackage;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "tumblr.com" }, urls = { "http://(www\\.)?(tumblr\\.com/audio_file/\\d+/tumblr_[A-Za-z0-9]+|[\\w\\.\\-]*?tumblr\\.com/post/\\d+)" }, flags = { 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "tumblr.com" }, urls = { "http://(www\\.)?(tumblr\\.com/audio_file/\\d+/tumblr_[A-Za-z0-9]+|[\\w\\.\\-]*?\\.tumblr\\.com(/post/\\d+|/page/\\d+)?)" }, flags = { 0 })
public class TumblrComDecrypter extends PluginForDecrypt {
public TumblrComDecrypter(PluginWrapper wrapper) {
@ -46,26 +47,58 @@ public class TumblrComDecrypter extends PluginForDecrypt {
return null;
}
decryptedLinks.add(createDownloadlink(finallink));
} else {
} else if (parameter.matches("http://(www\\.)?[\\w\\.\\-]*?\\.tumblr\\.com/post/\\d+")) {
// Single posts
br.setFollowRedirects(true);
br.getPage(parameter);
final String fpName = br.getRegex("<title>([^<>]*?)</title>").getMatch(0);
final String[] links = br.getRegex("<meta property=\"og:image\" content=\"(http://[^<>\"]*?)\"").getColumn(0);
if (links != null && links.length > 1) {
for (final String piclink : links) {
decryptedLinks.add(createDownloadlink("directhttp://" + piclink));
final String[][] regexes = { { "<meta (property=\"og:image\"|name=\"twitter:image\") content=\"(http://[^<>\"]*?)\"", "1" }, { "<p><img src=\"(http://(www\\.)?media\\.tumblr\\.com/[^<>\"]*?)\"", "0" } };
for (String[] regex : regexes) {
final String[] links = br.getRegex(Pattern.compile(regex[0], Pattern.CASE_INSENSITIVE)).getColumn(Integer.parseInt(regex[1]));
if (links != null && links.length > 1) {
for (final String piclink : links) {
decryptedLinks.add(createDownloadlink("directhttp://" + piclink));
}
}
if (fpName != null) {
FilePackage fp = FilePackage.getInstance();
fp.setName(Encoding.htmlDecode(fpName.trim()));
fp.addLinks(decryptedLinks);
}
if (decryptedLinks == null || decryptedLinks.size() == 0) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
if (fpName != null && !param.getBooleanProperty("nopackagename")) {
final FilePackage fp = FilePackage.getInstance();
fp.setName(Encoding.htmlDecode(fpName.trim()));
// Make only one package with same packagenames
fp.setProperty("ALLOW_MERGE", true);
fp.addLinks(decryptedLinks);
}
} else {
// Users
String nextPage = "1";
int counter = 1;
boolean decryptSingle = parameter.matches("http://(www\\.)?[\\w\\.\\-]*?\\.tumblr\\.com/page/\\d+");
br.getPage(parameter);
while (nextPage != null) {
logger.info("Decrypting page " + counter);
if (!nextPage.equals("1")) br.getPage(parameter + nextPage);
final String[] allPosts = br.getRegex("<div class=\"postmeta\"><a href=\"(http://(www\\.)?[\\w\\.\\-]*?\\.tumblr\\.com/post/\\d+)").getColumn(0);
if (allPosts == null || allPosts.length == 0) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
} else {
// Single links go to the host plugin, could be videos/mp3s
decryptedLinks.add(createDownloadlink(parameter.replace("tumblr.com/", "tumblrdecrypted.com/")));
for (final String post : allPosts) {
final DownloadLink fpost = createDownloadlink(post);
fpost.setProperty("nopackagename", true);
decryptedLinks.add(fpost);
}
if (decryptSingle) break;
nextPage = br.getRegex("\"(/page/\\d+)\" id=\"nav\\-next\"").getMatch(0);
counter++;
}
}
return decryptedLinks;
}
}

View File

@ -49,6 +49,11 @@ public class XXXAPornComDecrypter extends PluginForDecrypt {
decryptedLinks.add(dl);
return decryptedLinks;
}
tempID = br.getRegex("value=\\'conf(ig)?=(http://media\\.amateurcumshots\\.org/flv_player/data/playerConfigEmbed/\\d+\\.xml)").getMatch(1);
if (tempID != null) {
logger.info("Link offline: " + parameter);
return decryptedLinks;
}
decryptedLinks.add(createDownloadlink(parameter.replace("xxxaporn.com/", "xxxaporndecrypted.com/")));
return decryptedLinks;
}

View File

@ -1,547 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2011 JD-Team support@jdownloader.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.Account;
import jd.plugins.AccountInfo;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "bebasupload.com" }, urls = { "http://(www\\.)?bebasupload\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class BebasUploadCom extends PluginForHost {
private String BRBEFORE = "";
private static final String PASSWORDTEXT = "(<br><b>Password:</b> <input|<br><b>Passwort:</b> <input)";
private static final String COOKIE_HOST = "http://bebasupload.com";
public boolean NOPREMIUM = false;
public BebasUploadCom(PluginWrapper wrapper) {
super(wrapper);
this.enablePremium(COOKIE_HOST + "/premium.html");
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(BRBEFORE, PASSWORDTEXT).matches() || BRBEFORE.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
theLink.setProperty("pass", null);
throw new PluginException(LinkStatus.ERROR_RETRY);
}
if (BRBEFORE.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (BRBEFORE.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
// Some waittimes...
if (BRBEFORE.contains("You have to wait")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
if (waittime != 0) {
logger.info("Detected waittime #1, waiting " + waittime + " milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
}
}
if (BRBEFORE.contains("You have reached the download-limit")) {
String tmphrs = new Regex(BRBEFORE, "\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(BRBEFORE, "\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(BRBEFORE, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(BRBEFORE, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (BRBEFORE.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (BRBEFORE.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
// Errorhandling for only-premium links
if (new Regex(BRBEFORE, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file You requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(BRBEFORE, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium");
}
}
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (BRBEFORE.contains("No file")) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(BRBEFORE, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private String decodeDownloadLink(String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
return finallink;
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks) throws Exception, PluginException {
String dllink = null;
String passCode = null;
if (BRBEFORE.contains("\"download1\"")) {
br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replace("http://", "") + "/" + "([a-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=Free+Download");
doSomething();
}
checkErrors(downloadLink, false, passCode);
String md5hash = new Regex(BRBEFORE, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
br.setFollowRedirects(false);
// Videolinks can already be found here, if a link is found here we can
// skip waittimes and captchas
dllink = getDllink();
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(BRBEFORE, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* Captcha START */
if (BRBEFORE.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
// Captcha method by ManiacMansion
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (BRBEFORE.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode(captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(BRBEFORE, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.parse();
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
waitTime(timeBefore, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
// waittime is often skippable for reCaptcha handling
skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
br.submitForm(dlForm);
logger.info("Submitted DLForm");
doSomething();
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (passCode != null) {
downloadLink.setProperty("pass", passCode);
}
dl.startDownload();
}
// Removed fake messages which can kill the plugin
public void doSomething() throws NumberFormatException, PluginException {
BRBEFORE = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
BRBEFORE = BRBEFORE.replace(fun, "");
}
}
@Override
public AccountInfo fetchAccountInfo(Account account) throws Exception {
AccountInfo ai = new AccountInfo();
try {
login(account);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
String space = br.getRegex(Pattern.compile("<td>Used space:</td>.*?<td.*?b>([0-9\\.]+) of [0-9\\.]+ (Mb|GB)</b>", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
if (space != null) ai.setUsedSpace(space.trim() + " Mb");
String points = br.getRegex(Pattern.compile("<td>You have collected:</td.*?b>(.*?)premium points", Pattern.CASE_INSENSITIVE)).getMatch(0);
if (points != null) {
// Who needs half points ? If we have a dot in the points, just
// remove it
if (points.contains(".")) {
String dot = new Regex(points, ".*?(\\.(\\d+))").getMatch(0);
points = points.replace(dot, "");
}
ai.setPremiumPoints(Long.parseLong(points.trim()));
}
account.setValid(true);
String availabletraffic = new Regex(BRBEFORE, "Traffic available.*?:</TD><TD><b>(.*?)</b>").getMatch(0);
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equals(" Mb")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setUnlimitedTraffic();
}
if (!NOPREMIUM) {
String expire = new Regex(BRBEFORE, "<td>Premium-Account expire:</td>.*?<td>(.*?)</td>").getMatch(0);
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
expire = expire.replaceAll("(<b>|</b>)", "");
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", null));
}
ai.setStatus("Premium User");
} else {
ai.setStatus("Registered (free) User");
}
return ai;
}
// XfileSharingProBasic Version 2.3.0.0, added 1 fnf text
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(BRBEFORE, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(BRBEFORE, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(BRBEFORE, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = br.getRegex("p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
return dllink;
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return -1;
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
// Plugin was only made for registered acounts (only tested for those)
return 1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, true, 0);
}
public String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
if (thelink.getStringProperty("pass", null) == null) {
passCode = Plugin.getUserInput("Password?", thelink);
} else {
/* gespeicherten PassCode holen */
passCode = thelink.getStringProperty("pass", null);
}
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return passCode;
}
@Override
public void handlePremium(DownloadLink link, Account account) throws Exception {
String passCode = null;
requestFileInformation(link);
login(account);
br.setCookie(COOKIE_HOST, "lang", "english");
br.setFollowRedirects(false);
br.getPage(link.getDownloadURL());
doSomething();
if (NOPREMIUM) {
doFree(link, true, 0);
} else {
String dllink = br.getRedirectLocation();
if (dllink == null) {
doSomething();
Form DLForm = br.getFormbyProperty("name", "F1");
if (DLForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (new Regex(BRBEFORE, PASSWORDTEXT).matches()) passCode = handlePassword(passCode, DLForm, link);
br.submitForm(DLForm);
doSomething();
dllink = br.getRedirectLocation();
if (dllink == null) {
checkErrors(link, true, passCode);
dllink = getDllink();
}
}
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, link, dllink, true, 0);
if (passCode != null) {
link.setProperty("pass", passCode);
}
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl.startDownload();
}
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
private void login(Account account) throws Exception {
this.setBrowserExclusive();
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(COOKIE_HOST + "/login.html");
Form loginform = br.getForm(0);
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("login", Encoding.urlEncode(account.getUser()));
loginform.put("password", Encoding.urlEncode(account.getPass()));
br.submitForm(loginform);
if (br.getCookie(COOKIE_HOST, "login") == null || br.getCookie(COOKIE_HOST, "xfss") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
br.getPage(COOKIE_HOST + "/?op=my_account");
doSomething();
// new Regex(BRBEFORE,
// "(Premium-Account expire|Upgrade to premium|>Renew premium<)").getMatches()
if (!new Regex(BRBEFORE, "(Premium-Account expire|Upgrade to premium|>Renew premium<)").matches()) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
if (!new Regex(BRBEFORE, "(Premium-Account expire|>Renew premium<)").matches()) NOPREMIUM = true;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.setFollowRedirects(false);
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(link.getDownloadURL());
doSomething();
if (new Regex(BRBEFORE, "(>This server is in maintenance mode|No such file|File not found|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)").matches()) {
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
String filename = new Regex(BRBEFORE, "You have requested.*?http://(www\\.)?" + COOKIE_HOST.replace("http://", "") + "/[a-z0-9]{12}/(.*?)</font>").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "File Name.*?nowrap>(.*?)</td").getMatch(0);
}
}
}
}
}
String filesize = new Regex(BRBEFORE, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
filesize = new Regex(BRBEFORE, "<small>\\((.*?)\\)</small>").getMatch(0);
if (filesize == null) {
filesize = new Regex(BRBEFORE, "</font>[ ]+\\((.*?)\\)(.*?)</font>").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (BRBEFORE.contains("You have reached the download-limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(filename.trim());
if (filesize != null && !filesize.equals("")) {
logger.info("Filesize found, filesize = " + filesize);
link.setDownloadSize(SizeFormatter.getSize(filesize));
}
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
private void waitTime(long timeBefore, DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
// Ticket Time
String ttt = new Regex(BRBEFORE, "countdown\">.*?(\\d+).*?</span>").getMatch(0);
if (ttt == null) ttt = new Regex(BRBEFORE, "id=\"countdown_str\".*?<span id=\".*?\">.*?(\\d+).*?</span").getMatch(0);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1001l, downloadLink);
}
}
}

View File

@ -0,0 +1,775 @@
//jDownloader - Downloadmanager
//Copyright (C) 2012 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.Cookie;
import jd.http.Cookies;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.parser.html.InputField;
import jd.plugins.Account;
import jd.plugins.AccountInfo;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "blitzfiles.com" }, urls = { "https?://(www\\.)?blitzfiles\\.com/[a-z0-9]{12}" }, flags = { 2 })
public class BlitzFilesCom extends PluginForHost {
private String correctedBR = "";
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private final String COOKIE_HOST = "http://blitzfiles.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String MAINTENANCEUSERTEXT = JDL.L("hoster.xfilesharingprobasic.errors.undermaintenance", "This server is under Maintenance");
private static final String ALLWAIT_SHORT = JDL.L("hoster.xfilesharingprobasic.errors.waitingfordownloads", "Waiting till new downloads can be started");
private static final String PREMIUMONLY1 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly1", "Max downloadable filesize for free users:");
private static final String PREMIUMONLY2 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly2", "Only downloadable via premium or registered");
// note: can not be negative -x or 0 .:. [1-*]
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(1);
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
// DEV NOTES
/**
* Script notes: Streaming versions of this script sometimes redirect you to
* their directlinks when accessing this link + the link ID:
* http://somehoster.in/vidembed-
* */
// XfileSharingProBasic Version 2.5.7.6
// mods:
// non account: 1 * 1
// free account: 1 * 1
// premium account: untested, set standard limits
// protocol: no https
// captchatype: recaptcha
// other: no redirects
@Override
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("https://", "http://"));
}
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public BlitzFilesCom(PluginWrapper wrapper) {
super(wrapper);
this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
public void prepBrowser(final Browser br) {
// define custom browser headers and language settings.
br.getHeaders().put("Accept-Language", "en-gb, en;q=0.9, de;q=0.8");
br.setCookie(COOKIE_HOST, "lang", "english");
}
@Override
public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {
br.setFollowRedirects(true);
prepBrowser(br);
getPage(link.getDownloadURL());
br.setFollowRedirects(false);
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason for deletion:\n)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, MAINTENANCE).matches()) {
link.getLinkStatus().setStatusText(MAINTENANCEUSERTEXT);
return AvailableStatus.TRUE;
}
if (br.getURL().contains("/?op=login&redirect=")) {
link.getLinkStatus().setStatusText(PREMIUMONLY2);
return AvailableStatus.UNCHECKABLE;
}
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
waitTime(System.currentTimeMillis(), link);
sendForm(download1);
scanInfo(fileInfo);
}
}
if (fileInfo[0] == null || fileInfo[0].equals("")) {
if (correctedBR.contains("You have reached the download(\\-| )limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("filename equals null, throwing \"plugin defect\"");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (fileInfo[2] != null && !fileInfo[2].equals("")) link.setMD5Hash(fileInfo[2].trim());
fileInfo[0] = fileInfo[0].replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(fileInfo[0].trim());
if (fileInfo[1] != null && !fileInfo[1].equals("")) link.setDownloadSize(SizeFormatter.getSize(fileInfo[1]));
return AvailableStatus.TRUE;
}
private String[] scanInfo(final String[] fileInfo) {
// standard traits from base page
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
// traits from download1 page below.
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// next two are details from sharing box
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+>(.+) \\- [\\d\\.]+ (KB|MB|GB)</a></textarea>[\r\n\t ]+</div>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+\\](.+) \\- [\\d\\.]+ (KB|MB|GB)\\[/URL\\]").getMatch(0);
}
}
}
}
}
}
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "([\\d\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
}
if (fileInfo[2] == null) fileInfo[2] = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
return fileInfo;
}
@Override
public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, false, 1, "freelink");
}
public void doFree(final DownloadLink downloadLink, final boolean resumable, final int maxchunks, final String directlinkproperty) throws Exception, PluginException {
String passCode = null;
// First, bring up saved final links
String dllink = checkDirectLink(downloadLink, directlinkproperty);
// Second, check for streaming links on the first page
if (dllink == null) dllink = getDllink();
// Third, continue like normal.
if (dllink == null) {
checkErrors(downloadLink, false, passCode);
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
sendForm(download1);
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
}
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
// how many forms deep do you want to try.
int repeat = 3;
for (int i = 1; i <= repeat; i++) {
dlForm.remove(null);
final long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(correctedBR, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
// md5 can be on the subquent pages
if (downloadLink.getMD5Hash() == null) {
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) downloadLink.setMD5Hash(md5hash.trim());
}
/* Captcha START */
if (correctedBR.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
/** Captcha method by ManiacMansion */
String[][] letters = new Regex(br, "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(&#\\d+;)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), Encoding.htmlDecode(letter[1]));
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (correctedBR.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode("xfilesharingprobasic", captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(correctedBR, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.setForm(dlForm);
String id = new Regex(correctedBR, "\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
/** wait time is often skippable for reCaptcha handling */
skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
sendForm(dlForm);
logger.info("Submitted DLForm");
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null && (!br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"") || i == repeat)) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
} else if (dllink == null && br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"")) {
dlForm = br.getFormbyProperty("name", "F1");
continue;
} else {
break;
}
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
downloadLink.setProperty(directlinkproperty, dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
fixFilename(downloadLink);
try {
// add a download slot
controlFree(+1);
// start the dl
dl.startDownload();
} finally {
// remove download slot
controlFree(-1);
}
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return maxFree.get();
}
/**
* Prevents more than one free download from starting at a given time. One
* step prior to dl.startDownload(), it adds a slot to maxFree which allows
* the next singleton download to start, or at least try.
*
* This is needed because xfileshare(website) only throws errors after a
* final dllink starts transferring or at a given step within pre download
* sequence. But this template(XfileSharingProBasic) allows multiple
* slots(when available) to commence the download sequence,
* this.setstartintival does not resolve this issue. Which results in x(20)
* captcha events all at once and only allows one download to start. This
* prevents wasting peoples time and effort on captcha solving and|or
* wasting captcha trading credits. Users will experience minimal harm to
* downloading as slots are freed up soon as current download begins.
*
* @param controlFree
* (+1|-1)
*/
public synchronized void controlFree(final int num) {
logger.info("maxFree was = " + maxFree.get());
maxFree.set(Math.min(Math.max(1, maxFree.addAndGet(num)), totalMaxSimultanFreeDownload.get()));
logger.info("maxFree now = " + maxFree.get());
}
/** Remove HTML code which could break the plugin */
public void correctBR() throws NumberFormatException, PluginException {
correctedBR = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: ?none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
correctedBR = correctedBR.replace(fun, "");
}
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(correctedBR, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>(Click to Download|Download File)").getMatch(0);
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
}
}
return dllink;
}
private String decodeDownloadLink(final String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
}
return finallink;
}
private String checkDirectLink(final DownloadLink downloadLink, final String property) {
String dllink = downloadLink.getStringProperty(property);
if (dllink != null) {
try {
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = br2.openGetConnection(dllink);
if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
con.disconnect();
} catch (Exception e) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
}
return dllink;
}
private void getPage(final String page) throws Exception {
br.getPage(page);
correctBR();
}
private void postPage(final String page, final String postdata) throws Exception {
br.postPage(page, postdata);
correctBR();
}
private void sendForm(final Form form) throws Exception {
br.submitForm(form);
correctBR();
}
private void waitTime(long timeBefore, final DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
/** Ticket Time */
final String ttt = new Regex(correctedBR, "id=\"countdown_str\">[^<>\"]+<span id=\"[^<>\"]+\"( class=\"[^<>\"]+\")?>([\n ]+)?(\\d+)([\n ]+)?</span>").getMatch(2);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1000l, downloadLink);
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*
* @param key
* @param value
* @return
*/
private Form getFormByKey(final String key, final String value) {
Form[] workaround = br.getForms();
if (workaround != null) {
for (Form f : workaround) {
for (InputField field : f.getInputFields()) {
if (key != null && key.equals(field.getKey())) {
if (value == null && field.getValue() == null) return f;
if (value != null && value.equals(field.getValue())) return f;
}
}
}
}
return null;
}
private void fixFilename(final DownloadLink downloadLink) {
final String serverFilename = Encoding.htmlDecode(getFileNameFromHeader(dl.getConnection()));
final String newExtension = serverFilename.substring(serverFilename.lastIndexOf("."));
if (newExtension != null && !downloadLink.getFinalFileName().endsWith(newExtension)) {
final String oldExtension = downloadLink.getFinalFileName().substring(downloadLink.getFinalFileName().lastIndexOf("."));
if (oldExtension != null)
downloadLink.setFinalFileName(downloadLink.getFinalFileName().replace(oldExtension, newExtension));
else
downloadLink.setFinalFileName(downloadLink.getFinalFileName() + newExtension);
}
}
private String handlePassword(String passCode, final Form pwform, final DownloadLink thelink) throws IOException, PluginException {
passCode = thelink.getStringProperty("pass", null);
if (passCode == null) passCode = Plugin.getUserInput("Password?", thelink);
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return Encoding.urlEncode(passCode);
}
public void checkErrors(final DownloadLink theLink, final boolean checkAll, final String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(correctedBR, PASSWORDTEXT).matches() || correctedBR.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
throw new PluginException(LinkStatus.ERROR_RETRY, "Wrong password entered");
}
if (correctedBR.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (correctedBR.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
/** Wait time reconnect handling */
if (new Regex(correctedBR, "(You have reached the download(\\-| )limit|You have to wait)").matches()) {
// adjust this regex to catch the wait time string for COOKIE_HOST
String WAIT = new Regex(correctedBR, "((You have reached the download(\\-| )limit|You have to wait)[^<>]+)").getMatch(0);
String tmphrs = new Regex(WAIT, "\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs == null) tmphrs = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(WAIT, "\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin == null) tmpmin = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(WAIT, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(WAIT, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
/** Not enough wait time to reconnect->Wait and try again */
if (waittime < 180000) { throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.allwait", ALLWAIT_SHORT), waittime); }
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (correctedBR.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (correctedBR.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
/** Error handling for only-premium links */
if (new Regex(correctedBR, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file you requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(correctedBR, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.info("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY1 + " " + filesizelimit);
} else {
logger.info("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
}
}
if (br.getURL().contains("/?op=login&redirect=")) {
logger.info("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
}
if (new Regex(correctedBR, MAINTENANCE).matches()) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, MAINTENANCEUSERTEXT, 2 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (new Regex(correctedBR, Pattern.compile("No file", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(correctedBR, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private static AtomicInteger maxPrem = new AtomicInteger(1);
private static Object LOCK = new Object();
@Override
public AccountInfo fetchAccountInfo(Account account) throws Exception {
AccountInfo ai = new AccountInfo();
/* reset maxPrem workaround on every fetchaccount info */
maxPrem.set(1);
try {
login(account, true);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
final String space[][] = new Regex(correctedBR, "<td>Used space:</td>.*?<td.*?b>([0-9\\.]+) of [0-9\\.]+ (KB|MB|GB|TB)</b>").getMatches();
if ((space != null && space.length != 0) && (space[0][0] != null && space[0][1] != null)) ai.setUsedSpace(space[0][0] + " " + space[0][1]);
account.setValid(true);
final String availabletraffic = new Regex(correctedBR, "Traffic available.*?:</TD><TD><b>([^<>\"\\']+)</b>").getMatch(0);
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equalsIgnoreCase(" Mb")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setUnlimitedTraffic();
}
if (account.getBooleanProperty("nopremium")) {
ai.setStatus("Registered (free) User");
try {
maxPrem.set(1);
// free accounts can still have captcha.
totalMaxSimultanFreeDownload.set(maxPrem.get());
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(false);
} catch (final Throwable e) {
}
} else {
final String expire = new Regex(correctedBR, "(\\d{1,2} (January|February|March|April|May|June|July|August|September|October|November|December) \\d{4})").getMatch(0);
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", Locale.ENGLISH));
try {
maxPrem.set(1);
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(true);
} catch (final Throwable e) {
}
}
ai.setStatus("Premium User");
}
return ai;
}
@SuppressWarnings("unchecked")
private void login(final Account account, final boolean force) throws Exception {
synchronized (LOCK) {
try {
/** Load cookies */
br.setCookiesExclusive(true);
prepBrowser(br);
final Object ret = account.getProperty("cookies", null);
boolean acmatch = Encoding.urlEncode(account.getUser()).equals(account.getStringProperty("name", Encoding.urlEncode(account.getUser())));
if (acmatch) acmatch = Encoding.urlEncode(account.getPass()).equals(account.getStringProperty("pass", Encoding.urlEncode(account.getPass())));
if (acmatch && ret != null && ret instanceof HashMap<?, ?> && !force) {
final HashMap<String, String> cookies = (HashMap<String, String>) ret;
if (account.isValid()) {
for (final Map.Entry<String, String> cookieEntry : cookies.entrySet()) {
final String key = cookieEntry.getKey();
final String value = cookieEntry.getValue();
this.br.setCookie(COOKIE_HOST, key, value);
}
return;
}
}
br.setFollowRedirects(true);
getPage(COOKIE_HOST + "/login.html");
final Form loginform = br.getFormbyProperty("name", "FL");
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("login", Encoding.urlEncode(account.getUser()));
loginform.put("password", Encoding.urlEncode(account.getPass()));
sendForm(loginform);
if (br.getCookie(COOKIE_HOST, "login") == null || br.getCookie(COOKIE_HOST, "xfss") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
getPage(COOKIE_HOST + "/?op=my_account");
if (!new Regex(correctedBR, "(Premium(\\-| )Account expire|>Renew premium<)").matches()) {
account.setProperty("nopremium", true);
} else {
account.setProperty("nopremium", false);
}
/** Save cookies */
final HashMap<String, String> cookies = new HashMap<String, String>();
final Cookies add = this.br.getCookies(COOKIE_HOST);
for (final Cookie c : add.getCookies()) {
cookies.put(c.getKey(), c.getValue());
}
account.setProperty("name", Encoding.urlEncode(account.getUser()));
account.setProperty("pass", Encoding.urlEncode(account.getPass()));
account.setProperty("cookies", cookies);
} catch (final PluginException e) {
account.setProperty("cookies", Property.NULL);
throw e;
}
}
}
@Override
public void handlePremium(final DownloadLink downloadLink, final Account account) throws Exception {
String passCode = null;
requestFileInformation(downloadLink);
login(account, false);
br.setFollowRedirects(false);
String dllink = null;
if (account.getBooleanProperty("nopremium")) {
requestFileInformation(downloadLink);
doFree(downloadLink, false, 1, "freelink2");
} else {
dllink = checkDirectLink(downloadLink, "premlink");
if (dllink == null) {
getPage(downloadLink.getDownloadURL());
dllink = getDllink();
if (dllink == null) {
checkErrors(downloadLink, true, passCode);
Form dlform = br.getFormbyProperty("name", "F1");
if (dlform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (new Regex(correctedBR, PASSWORDTEXT).matches()) passCode = handlePassword(passCode, dlform, downloadLink);
sendForm(dlform);
dllink = getDllink();
checkErrors(downloadLink, true, passCode);
}
}
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, -10);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (passCode != null) downloadLink.setProperty("pass", passCode);
fixFilename(downloadLink);
downloadLink.setProperty("premlink", dllink);
dl.startDownload();
}
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
/* workaround for free/premium issue on stable 09581 */
return maxPrem.get();
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
}

View File

@ -19,6 +19,9 @@ package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
@ -27,12 +30,16 @@ import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.Cookie;
import jd.http.Cookies;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.parser.html.InputField;
import jd.plugins.Account;
import jd.plugins.AccountInfo;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
@ -44,8 +51,9 @@ import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "exclusivefaile.com" }, urls = { "https?://(www\\.)?exclusivefaile\\.com/[a-z0-9]{12}" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "exclusivefaile.com" }, urls = { "https?://(www\\.)?exclusivefaile\\.com/[a-z0-9]{12}" }, flags = { 2 })
public class ExclusiveFaileCom extends PluginForHost {
private String correctedBR = "";
@ -57,16 +65,16 @@ public class ExclusiveFaileCom extends PluginForHost {
private static final String PREMIUMONLY1 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly1", "Max downloadable filesize for free users:");
private static final String PREMIUMONLY2 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly2", "Only downloadable via premium or registered");
// note: can not be negative -x or 0 .:. [1-*]
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(20);
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(2);
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
// DEV NOTES
// XfileSharingProBasic Version 2.5.6.8-raz
// mods:
// non account: 1 * maxdl
// free account:
// premium account:
// non account: 1 * 2
// free account: 20 * 1
// premium account: untested, set standard limits
// protocol: no https
// captchatype: null
// other: no redirects
@ -83,7 +91,7 @@ public class ExclusiveFaileCom extends PluginForHost {
public ExclusiveFaileCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
@ -104,7 +112,6 @@ public class ExclusiveFaileCom extends PluginForHost {
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws Exception {
this.setBrowserExclusive();
br.setFollowRedirects(false);
prepBrowser();
getPage(link.getDownloadURL());
@ -584,4 +591,156 @@ public class ExclusiveFaileCom extends PluginForHost {
return null;
}
private static AtomicInteger maxPrem = new AtomicInteger(1);
private static Object LOCK = new Object();
@Override
public AccountInfo fetchAccountInfo(Account account) throws Exception {
AccountInfo ai = new AccountInfo();
/* reset maxPrem workaround on every fetchaccount info */
maxPrem.set(1);
try {
login(account, true);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
final String space[][] = new Regex(correctedBR, "<td>Used space:</td>.*?<td.*?b>([0-9\\.]+) of [0-9\\.]+ (KB|MB|GB|TB)</b>").getMatches();
if ((space != null && space.length != 0) && (space[0][0] != null && space[0][1] != null)) ai.setUsedSpace(space[0][0] + " " + space[0][1]);
account.setValid(true);
final String availabletraffic = new Regex(correctedBR, "Traffic available.*?:</TD><TD><b>([^<>\"\\']+)</b>").getMatch(0);
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equalsIgnoreCase(" Mb")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setUnlimitedTraffic();
}
if (account.getBooleanProperty("nopremium")) {
ai.setStatus("Registered (free) User");
try {
maxPrem.set(1);
// free accounts can still have captcha.
totalMaxSimultanFreeDownload.set(maxPrem.get());
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(false);
} catch (final Throwable e) {
}
} else {
final String expire = new Regex(correctedBR, "(\\d{1,2} (January|February|March|April|May|June|July|August|September|October|November|December) \\d{4})").getMatch(0);
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", Locale.ENGLISH));
try {
maxPrem.set(1);
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(true);
} catch (final Throwable e) {
}
}
ai.setStatus("Premium User");
}
return ai;
}
@SuppressWarnings("unchecked")
private void login(final Account account, final boolean force) throws Exception {
synchronized (LOCK) {
try {
/** Load cookies */
br.setCookiesExclusive(true);
final Object ret = account.getProperty("cookies", null);
boolean acmatch = Encoding.urlEncode(account.getUser()).equals(account.getStringProperty("name", Encoding.urlEncode(account.getUser())));
if (acmatch) acmatch = Encoding.urlEncode(account.getPass()).equals(account.getStringProperty("pass", Encoding.urlEncode(account.getPass())));
if (acmatch && ret != null && ret instanceof HashMap<?, ?> && !force) {
final HashMap<String, String> cookies = (HashMap<String, String>) ret;
if (account.isValid()) {
for (final Map.Entry<String, String> cookieEntry : cookies.entrySet()) {
final String key = cookieEntry.getKey();
final String value = cookieEntry.getValue();
this.br.setCookie(COOKIE_HOST, key, value);
}
return;
}
}
br.setFollowRedirects(true);
getPage(COOKIE_HOST + "/login.html");
final Form loginform = br.getFormbyProperty("name", "FL");
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("login", Encoding.urlEncode(account.getUser()));
loginform.put("password", Encoding.urlEncode(account.getPass()));
sendForm(loginform);
if (br.getCookie(COOKIE_HOST, "login") == null || br.getCookie(COOKIE_HOST, "xfss") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
getPage(COOKIE_HOST + "/?op=my_account");
if (!new Regex(correctedBR, "(Premium(\\-| )Account expire|>Renew premium<)").matches()) {
account.setProperty("nopremium", true);
} else {
account.setProperty("nopremium", false);
}
/** Save cookies */
final HashMap<String, String> cookies = new HashMap<String, String>();
final Cookies add = this.br.getCookies(COOKIE_HOST);
for (final Cookie c : add.getCookies()) {
cookies.put(c.getKey(), c.getValue());
}
account.setProperty("name", Encoding.urlEncode(account.getUser()));
account.setProperty("pass", Encoding.urlEncode(account.getPass()));
account.setProperty("cookies", cookies);
} catch (final PluginException e) {
account.setProperty("cookies", Property.NULL);
throw e;
}
}
}
@Override
public void handlePremium(final DownloadLink downloadLink, final Account account) throws Exception {
String passCode = null;
requestFileInformation(downloadLink);
login(account, true);
br.setFollowRedirects(false);
String dllink = null;
if (account.getBooleanProperty("nopremium")) {
requestFileInformation(downloadLink);
doFree(downloadLink, true, 0, "freelink2");
} else {
dllink = checkDirectLink(downloadLink, "premlink");
if (dllink == null) {
getPage(downloadLink.getDownloadURL());
dllink = getDllink();
if (dllink == null) {
checkErrors(downloadLink, true, passCode);
Form dlform = br.getFormbyProperty("name", "F1");
if (dlform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (new Regex(correctedBR, PASSWORDTEXT).matches()) passCode = handlePassword(passCode, dlform, downloadLink);
sendForm(dlform);
dllink = getDllink();
checkErrors(downloadLink, true, passCode);
}
}
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, -10);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (passCode != null) downloadLink.setProperty("pass", passCode);
downloadLink.setProperty("premlink", dllink);
dl.startDownload();
}
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
/* workaround for free/premium issue on stable 09581 */
return maxPrem.get();
}
}

View File

@ -45,7 +45,7 @@ import org.appwork.utils.formatter.TimeFormatter;
public class FileFilesNet extends PluginForHost {
private static final String HOST = "http://flyfiles.net";
private static Object LOCK = new Object();
private static Object LOCK = new Object();
// TODO: rename plugin when jd2 goes stable, FlyFilesNet
@ -112,7 +112,7 @@ public class FileFilesNet extends PluginForHost {
dllink = getDllink();
if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, -3);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, 1);
if (dl.getConnection().getContentType().contains("html")) {
br.followConnection();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);

View File

@ -1,444 +0,0 @@
//jDownloader - Downloadmanager
//Copyright (C) 2011 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import jd.PluginWrapper;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "fileserver.cc" }, urls = { "http://(www\\.)?fileserver\\.cc/[a-z0-9]{12}" }, flags = { 0 })
public class FileServerCc extends PluginForHost {
private String BRBEFORE = "";
private static final String PASSWORDTEXT0 = "<br><b>Password:</b> <input";
private static final String PASSWORDTEXT1 = "<br><b>Passwort:</b> <input";
private static final String COOKIE_HOST = "http://fileserver.cc";
public boolean NOPREMIUM = false;
public FileServerCc(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (BRBEFORE.contains("<br><b>Password:</b> <input") || BRBEFORE.contains("<br><b>Passwort:</b> <input") || BRBEFORE.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
theLink.setProperty("pass", null);
throw new PluginException(LinkStatus.ERROR_RETRY);
}
if (BRBEFORE.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (BRBEFORE.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
// Some waittimes...
if (BRBEFORE.contains("You have to wait")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
if (waittime != 0) {
logger.info("Detected waittime #1, waiting " + waittime + " milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
}
}
if (BRBEFORE.contains("You have reached the download-limit")) {
String tmphrs = new Regex(BRBEFORE, "\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(BRBEFORE, "\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(BRBEFORE, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(BRBEFORE, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (BRBEFORE.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (BRBEFORE.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
// Errorhandling for only-premium links
if (BRBEFORE.contains(" can download files up to ") || BRBEFORE.contains("Upgrade your account to download bigger files") || BRBEFORE.contains(">Upgrade your account to download larger files") || BRBEFORE.contains(">The file You requested reached max downloads limit for Free Users") || BRBEFORE.contains("Please Buy Premium To download this file<") || BRBEFORE.contains("This file reached max downloads limit")) {
String filesizelimit = new Regex(BRBEFORE, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium");
}
}
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (BRBEFORE.contains("No file")) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (BRBEFORE.contains("File Not Found") || BRBEFORE.contains("<h1>404 Not Found</h1>")) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private String decodeDownloadLink(String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) finallink = new Regex(decoded, "s1\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
return finallink;
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks) throws Exception, PluginException {
String dllink = null;
String passCode = null;
if (BRBEFORE.contains("\"download1\"")) {
br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replace("http://", "") + "/" + "([a-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=Free+Download");
doSomething();
}
checkErrors(downloadLink, false, passCode);
String md5hash = new Regex(BRBEFORE, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
br.setFollowRedirects(false);
// Videolinks can already be found here, if a link is found here we can
// skip waittimes and captchas
dllink = getDllink();
if (dllink == null) {
Form DLForm = br.getFormbyProperty("name", "F1");
if (DLForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean recaptcha = false;
if (BRBEFORE.contains(PASSWORDTEXT0) || BRBEFORE.contains(PASSWORDTEXT1)) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* Captcha START */
if (BRBEFORE.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
// Captcha method by ManiacMansion
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style='position:absolute;padding-left:(\\d+)px;padding-top:\\d+px;'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
DLForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (BRBEFORE.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode(captchaurl, downloadLink);
DLForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (BRBEFORE.contains("api.recaptcha.net") || BRBEFORE.contains("google.com/recaptcha/api/")) {
// Some hosters also got commentfields with captchas, therefore
// is
// the !br.contains...check Exampleplugin:
// FileGigaCom
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.parse();
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
if (password) {
passCode = handlePassword(passCode, rc.getForm(), downloadLink);
}
recaptcha = true;
// waitTime(timeBefore, downloadLink);
rc.setCode(c);
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dllink = br.getRedirectLocation();
}
/* Captcha END */
// If the hoster uses Re Captcha the form has already been sent
// before
// here so here it's checked. Most hosters don't use Re Captcha so
// usually recaptcha is false
if (!recaptcha) {
if (password) {
passCode = handlePassword(passCode, DLForm, downloadLink);
}
waitTime(timeBefore, downloadLink);
br.submitForm(DLForm);
logger.info("Submitted DLForm");
}
doSomething();
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (passCode != null) {
downloadLink.setProperty("pass", passCode);
}
dl.startDownload();
}
// Removed fake messages which can kill the plugin
public void doSomething() throws NumberFormatException, PluginException {
BRBEFORE = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
BRBEFORE = BRBEFORE.replace(fun, "");
}
}
// XfileSharingProBasic Version 2.1.1.4
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(BRBEFORE, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(BRBEFORE, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(BRBEFORE, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = br.getRegex("p}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
return dllink;
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return 1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, true, 0);
}
public String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
if (thelink.getStringProperty("pass", null) == null) {
passCode = Plugin.getUserInput("Password?", thelink);
} else {
/* gespeicherten PassCode holen */
passCode = thelink.getStringProperty("pass", null);
}
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return passCode;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.setFollowRedirects(false);
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(link.getDownloadURL());
doSomething();
if (BRBEFORE.contains("No such file") || BRBEFORE.contains("No such user exist") || BRBEFORE.contains("File not found") || BRBEFORE.contains(">File Not Found<")) {
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
String filename = new Regex(BRBEFORE, "You have requested.*?http://.*?[a-z0-9]{12}/(.*?)</font>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "File Name.*?nowrap>(.*?)</td").getMatch(0);
}
}
}
}
}
String filesize = new Regex(BRBEFORE, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
filesize = new Regex(BRBEFORE, "<small>\\((.*?)\\)</small>").getMatch(0);
if (filesize == null) {
filesize = new Regex(BRBEFORE, "</font>[ ]+\\((.*?)\\)(.*?)</font>").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (BRBEFORE.contains("You have reached the download-limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(filename.trim());
if (filesize != null && !filesize.equals("")) {
logger.info("Filesize found, filesize = " + filesize);
link.setDownloadSize(SizeFormatter.getSize(filesize));
}
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
private void waitTime(long timeBefore, DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
// Ticket Time
String ttt = new Regex(BRBEFORE, "countdown\">.*?(\\d+).*?</span>").getMatch(0);
if (ttt == null) ttt = new Regex(BRBEFORE, "id=\"countdown_str\".*?<span id=\".*?\">.*?(\\d+).*?</span").getMatch(0);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1001l, downloadLink);
}
}
}

View File

@ -68,14 +68,15 @@ public class FileStayCom extends PluginForHost {
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
private static AtomicInteger maxPrem = new AtomicInteger(1);
private static Object LOCK = new Object();
private static Object LOCK = new Object();
// DEV NOTES
// XfileSharingProBasic Version 2.5.6.7-raz
// mods: checkerrors(premium only file), premium html references
// non account: 1 * unlimited
// free account: same as above
// premium account: 10 * 1 (issues with nginx, but they have multiple fileserve's)
// premium account: 10 * 1 (issues with nginx, but they have multiple
// fileserve's)
// protocol: no https
// captchatype: recaptcha
// other: no redirects
@ -125,7 +126,8 @@ public class FileStayCom extends PluginForHost {
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission critical
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
@ -332,14 +334,19 @@ public class FileStayCom extends PluginForHost {
}
/**
* Prevents more than one free download from starting at a given time. One step prior to dl.startDownload(), it adds a slot to maxFree
* which allows the next singleton download to start, or at least try.
* Prevents more than one free download from starting at a given time. One
* step prior to dl.startDownload(), it adds a slot to maxFree which allows
* the next singleton download to start, or at least try.
*
* This is needed because xfileshare(website) only throws errors after a final dllink starts transferring or at a given step within pre
* download sequence. But this template(XfileSharingProBasic) allows multiple slots(when available) to commence the download sequence,
* this.setstartintival does not resolve this issue. Which results in x(20) captcha events all at once and only allows one download to
* start. This prevents wasting peoples time and effort on captcha solving and|or wasting captcha trading credits. Users will experience
* minimal harm to downloading as slots are freed up soon as current download begins.
* This is needed because xfileshare(website) only throws errors after a
* final dllink starts transferring or at a given step within pre download
* sequence. But this template(XfileSharingProBasic) allows multiple
* slots(when available) to commence the download sequence,
* this.setstartintival does not resolve this issue. Which results in x(20)
* captcha events all at once and only allows one download to start. This
* prevents wasting peoples time and effort on captcha solving and|or
* wasting captcha trading credits. Users will experience minimal harm to
* downloading as slots are freed up soon as current download begins.
*
* @param controlFree
* (+1|-1)
@ -381,10 +388,13 @@ public class FileStayCom extends PluginForHost {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>(Click to Download|Download File)").getMatch(0);
// generic fail over for COOKIE_HOST on final link format.
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR, "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR, "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
@ -658,6 +668,7 @@ public class FileStayCom extends PluginForHost {
getPage(link.getDownloadURL());
dllink = getDllink();
if (dllink == null) {
// TODO: Fix this if you have an account
checkErrors(link, true, passCode);
Form dlform = br.getFormbyProperty("name", "F1");
if (dlform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
@ -712,7 +723,8 @@ public class FileStayCom extends PluginForHost {
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key, String value)
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*

View File

@ -0,0 +1,612 @@
//jDownloader - Downloadmanager
//Copyright (C) 2012 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.parser.html.InputField;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "flazhshare.com" }, urls = { "https?://(www\\.)?flazhshare\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class FlazhShareCom extends PluginForHost {
private String correctedBR = "";
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private final String COOKIE_HOST = "http://flazhshare.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String MAINTENANCEUSERTEXT = JDL.L("hoster.xfilesharingprobasic.errors.undermaintenance", "This server is under Maintenance");
private static final String ALLWAIT_SHORT = JDL.L("hoster.xfilesharingprobasic.errors.waitingfordownloads", "Waiting till new downloads can be started");
private static final String PREMIUMONLY1 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly1", "Max downloadable filesize for free users:");
private static final String PREMIUMONLY2 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly2", "Only downloadable via premium or registered");
// note: can not be negative -x or 0 .:. [1-*]
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(20);
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
// DEV NOTES
/**
* Script notes: Streaming versions of this script sometimes redirect you to
* their directlinks when accessing this link + the link ID:
* http://somehoster.in/vidembed-
* */
// XfileSharingProBasic Version 2.5.7.5
// mods:
// non account: 1 * 1
// free account: chunk * maxdl
// premium account: chunk * maxdl
// protocol: no https
// captchatype: 4dignum
// other: no redirects
@Override
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("https://", "http://"));
}
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public FlazhShareCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
public void prepBrowser(final Browser br) {
// define custom browser headers and language settings.
br.getHeaders().put("Accept-Language", "en-gb, en;q=0.9, de;q=0.8");
br.setCookie(COOKIE_HOST, "lang", "english");
}
@Override
public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {
br.setFollowRedirects(true);
prepBrowser(br);
getPage(link.getDownloadURL());
br.setFollowRedirects(false);
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason for deletion:\n)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, MAINTENANCE).matches()) {
link.getLinkStatus().setStatusText(MAINTENANCEUSERTEXT);
return AvailableStatus.TRUE;
}
if (br.getURL().contains("/?op=login&redirect=")) {
link.getLinkStatus().setStatusText(PREMIUMONLY2);
return AvailableStatus.UNCHECKABLE;
}
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
waitTime(System.currentTimeMillis(), link);
sendForm(download1);
scanInfo(fileInfo);
}
}
if (fileInfo[0] == null || fileInfo[0].equals("")) {
if (correctedBR.contains("You have reached the download(\\-| )limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("filename equals null, throwing \"plugin defect\"");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (fileInfo[2] != null && !fileInfo[2].equals("")) link.setMD5Hash(fileInfo[2].trim());
fileInfo[0] = fileInfo[0].replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(fileInfo[0].trim());
if (fileInfo[1] != null && !fileInfo[1].equals("")) link.setDownloadSize(SizeFormatter.getSize(fileInfo[1]));
return AvailableStatus.TRUE;
}
private String[] scanInfo(final String[] fileInfo) {
// standard traits from base page
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
// traits from download1 page below.
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// next two are details from sharing box
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+>(.+) \\- [\\d\\.]+ (KB|MB|GB)</a></textarea>[\r\n\t ]+</div>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+\\](.+) \\- [\\d\\.]+ (KB|MB|GB)\\[/URL\\]").getMatch(0);
}
}
}
}
}
}
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "([\\d\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
}
if (fileInfo[2] == null) fileInfo[2] = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
return fileInfo;
}
@Override
public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, false, 1, "freelink");
}
public void doFree(final DownloadLink downloadLink, final boolean resumable, final int maxchunks, final String directlinkproperty) throws Exception, PluginException {
String passCode = null;
// First, bring up saved final links
String dllink = checkDirectLink(downloadLink, directlinkproperty);
// Second, check for streaming links on the first page
if (dllink == null) dllink = getDllink();
// Third, continue like normal.
if (dllink == null) {
checkErrors(downloadLink, false, passCode);
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
sendForm(download1);
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
}
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
// how many forms deep do you want to try.
int repeat = 3;
for (int i = 1; i <= repeat; i++) {
dlForm.remove(null);
final long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(correctedBR, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
// md5 can be on the subquent pages
if (downloadLink.getMD5Hash() == null) {
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) downloadLink.setMD5Hash(md5hash.trim());
}
/* Captcha START */
if (correctedBR.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
/** Captcha method by ManiacMansion */
String[][] letters = new Regex(br, "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(&#\\d+;)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), Encoding.htmlDecode(letter[1]));
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (correctedBR.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode("xfilesharingprobasic", captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(correctedBR, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.setForm(dlForm);
String id = new Regex(correctedBR, "\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
/** wait time is often skippable for reCaptcha handling */
skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
sendForm(dlForm);
logger.info("Submitted DLForm");
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null && (!br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"") || i == repeat)) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
} else if (dllink == null && br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"")) {
dlForm = br.getFormbyProperty("name", "F1");
continue;
} else {
break;
}
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
downloadLink.setProperty(directlinkproperty, dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
fixFilename(downloadLink);
try {
// add a download slot
controlFree(+1);
// start the dl
dl.startDownload();
} finally {
// remove download slot
controlFree(-1);
}
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return maxFree.get();
}
/**
* Prevents more than one free download from starting at a given time. One
* step prior to dl.startDownload(), it adds a slot to maxFree which allows
* the next singleton download to start, or at least try.
*
* This is needed because xfileshare(website) only throws errors after a
* final dllink starts transferring or at a given step within pre download
* sequence. But this template(XfileSharingProBasic) allows multiple
* slots(when available) to commence the download sequence,
* this.setstartintival does not resolve this issue. Which results in x(20)
* captcha events all at once and only allows one download to start. This
* prevents wasting peoples time and effort on captcha solving and|or
* wasting captcha trading credits. Users will experience minimal harm to
* downloading as slots are freed up soon as current download begins.
*
* @param controlFree
* (+1|-1)
*/
public synchronized void controlFree(final int num) {
logger.info("maxFree was = " + maxFree.get());
maxFree.set(Math.min(Math.max(1, maxFree.addAndGet(num)), totalMaxSimultanFreeDownload.get()));
logger.info("maxFree now = " + maxFree.get());
}
/** Remove HTML code which could break the plugin */
public void correctBR() throws NumberFormatException, PluginException {
correctedBR = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: ?none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
correctedBR = correctedBR.replace(fun, "");
}
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(correctedBR, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>(Click to Download|Download File)").getMatch(0);
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
}
}
return dllink;
}
private String decodeDownloadLink(final String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
}
return finallink;
}
private String checkDirectLink(final DownloadLink downloadLink, final String property) {
String dllink = downloadLink.getStringProperty(property);
if (dllink != null) {
try {
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = br2.openGetConnection(dllink);
if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
con.disconnect();
} catch (Exception e) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
}
return dllink;
}
private void getPage(final String page) throws Exception {
br.getPage(page);
correctBR();
}
private void postPage(final String page, final String postdata) throws Exception {
br.postPage(page, postdata);
correctBR();
}
private void sendForm(final Form form) throws Exception {
br.submitForm(form);
correctBR();
}
private void waitTime(long timeBefore, final DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
/** Ticket Time */
final String ttt = new Regex(correctedBR, "id=\"countdown_str\">[^<>\"]+<span id=\"[^<>\"]+\"( class=\"[^<>\"]+\")?>([\n ]+)?(\\d+)([\n ]+)?</span>").getMatch(2);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1000l, downloadLink);
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*
* @param key
* @param value
* @return
*/
private Form getFormByKey(final String key, final String value) {
Form[] workaround = br.getForms();
if (workaround != null) {
for (Form f : workaround) {
for (InputField field : f.getInputFields()) {
if (key != null && key.equals(field.getKey())) {
if (value == null && field.getValue() == null) return f;
if (value != null && value.equals(field.getValue())) return f;
}
}
}
}
return null;
}
private void fixFilename(final DownloadLink downloadLink) {
final String serverFilename = Encoding.htmlDecode(getFileNameFromHeader(dl.getConnection()));
final String newExtension = serverFilename.substring(serverFilename.lastIndexOf("."));
if (newExtension != null && !downloadLink.getFinalFileName().endsWith(newExtension)) {
final String oldExtension = downloadLink.getFinalFileName().substring(downloadLink.getFinalFileName().lastIndexOf("."));
if (oldExtension != null)
downloadLink.setFinalFileName(downloadLink.getFinalFileName().replace(oldExtension, newExtension));
else
downloadLink.setFinalFileName(downloadLink.getFinalFileName() + newExtension);
}
}
private String handlePassword(String passCode, final Form pwform, final DownloadLink thelink) throws IOException, PluginException {
passCode = thelink.getStringProperty("pass", null);
if (passCode == null) passCode = Plugin.getUserInput("Password?", thelink);
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return Encoding.urlEncode(passCode);
}
public void checkErrors(final DownloadLink theLink, final boolean checkAll, final String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(correctedBR, PASSWORDTEXT).matches() || correctedBR.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
throw new PluginException(LinkStatus.ERROR_RETRY, "Wrong password entered");
}
if (correctedBR.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (correctedBR.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
/** Wait time reconnect handling */
if (new Regex(correctedBR, "(You have reached the download(\\-| )limit|You have to wait)").matches()) {
// adjust this regex to catch the wait time string for COOKIE_HOST
String WAIT = new Regex(correctedBR, "((You have reached the download(\\-| )limit|You have to wait)[^<>]+)").getMatch(0);
String tmphrs = new Regex(WAIT, "\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs == null) tmphrs = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(WAIT, "\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin == null) tmpmin = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(WAIT, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(WAIT, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
/** Not enough wait time to reconnect->Wait and try again */
if (waittime < 180000) { throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.allwait", ALLWAIT_SHORT), waittime); }
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (correctedBR.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (correctedBR.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
/** Error handling for only-premium links */
if (new Regex(correctedBR, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file you requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(correctedBR, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.info("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY1 + " " + filesizelimit);
} else {
logger.info("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
}
}
if (br.getURL().contains("/?op=login&redirect=")) {
logger.info("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
}
if (new Regex(correctedBR, MAINTENANCE).matches()) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, MAINTENANCEUSERTEXT, 2 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (new Regex(correctedBR, Pattern.compile("No file", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(correctedBR, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
}

View File

@ -30,7 +30,7 @@ import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "imagefap.com" }, urls = { "http://(www\\.)?imagefap.com/(image\\.php\\?id=.*(&pgid=.*&gid=.*&page=.*)?|video\\.php\\?vid=\\d+)" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "imagefap.com" }, urls = { "http://(www\\.)?imagefap.com/(image\\.php\\?id=.*(\\&pgid=.*\\&gid=.*\\&page=.*)?|video\\.php\\?vid=\\d+)" }, flags = { 0 })
public class ImageFap extends PluginForHost {
public ImageFap(final PluginWrapper wrapper) {

View File

@ -35,20 +35,20 @@ import jd.plugins.PluginForHost;
/* Set interfaceVersion to 3 to avoid old Stable trying to load this Plugin */
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "divxbase.com", "gptfile.com", "dudupload.com", "eyvx.com", "farshare.to", "azsharing.com", "freefilessharing.com", "elitedisk.com", "freakmov.com", "cloudnator.com", "filesavr.com", "saveufile.in.th", "migahost.com", "fastfreefilehosting.com", "files2k.eu", "shafiles.me", "jalurcepat.com", "divload.org", "refile.net", "oron.com", "wupload.com", "filesonic.com", "xxlupload.com", "cumfox.com", "pyramidfiles.com", "nahraj.cz", "jsharer.com", "annonhost.net", "filekeeper.org", "dynyoo.com", "163pan.com", "imagehost.org", "4us.to", "yabadaba.ru", "madshare.com", "diglo.com", "tubeload.to", "tunabox.net", "yourfilehost.com", "uploadegg.com", "brsbox.com", "amateurboobtube.com", "good.net", "freeload.to", "netporn.nl", "przeklej.pl", "alldrives.ge", "allshares.ge", "holderfile.com", "megashare.vnn.vn", "link.ge",
"up.jeje.ge", "up-4.com", "cloudcache", "ddlanime.com", "mountfile.com", "platinshare.com", "ishare.iask.sina.com.cn", "megavideo.com", "megaupload.com", "cum.com", "zshare.net", "uploading4u.com", "megafree.kz", "batubia.com", "upload24.net", "files.namba.kz", "datumbit.com", "fik1.com", "fileape.com", "filezzz.com", "imagewaste.com", "fyels.com", "gotupload.com", "sharehub.com", "sharehut.com", "filesurf.ru", "openfile.ru", "letitfile.ru", "tab.net.ua", "uploadbox.com", "supashare.net", "usershare.net", "skipfile.com", "10upload.com", "x7.to", "multiupload.com", "uploadking.com", "uploadhere.com", "fileshaker.com", "vistaupload.com", "groovefile.com", "enterupload.com", "xshareware.com", "xun6.com", "yourupload.de", "youshare.eu", "mafiaupload.com", "addat.hu", "archiv.to", "bigupload.com", "biggerupload.com", "bitload.com", "bufiles.com", "cash-file.net", "combozip.com",
"duckload.com", "exoshare.com", "file2upload.net", "filebase.to", "filebling.com", "filecrown.com", "filefrog.to", "filefront.com", "filehook.com", "filestage.to", "filezup.com", "fullshare.net", "gaiafile.com", "keepfile.com", "kewlshare.com", "lizshare.net", "loaded.it", "loadfiles.in", "megarapid.eu", "megashare.vn", "metahyper.com", "missupload.com", "netstorer.com", "nextgenvidz.com", "piggyshare.com", "profitupload.com", "quickload.to", "quickyshare.com", "share.cx", "sharehoster.de", "shareua.com", "speedload.to", "upfile.in", "ugotfile.com", "upload.ge", "uploadmachine.com", "uploady.to", "uploadstore.net", "vspace.cc", "web-share.net", "yvh.cc", "x-files.kz" }, urls = { "https?://(www\\.)?divxbase\\.com/[a-z0-9]{12}", "https?://(www\\.)?gptfile\\.com/[a-z0-9]{12}", "https?://(www\\.)?dudupload\\.com/[a-z0-9]{12}", "http://(www\\.)?eyvx\\.com/[a-z0-9]{12}",
"http://(www\\.)?farshare\\.to/[a-z0-9]{12}", "http://(www\\.)?azsharing\\.com/[a-z0-9]{12}/", "http://(www\\.)?freefilessharing\\.com/[a-z0-9]{12}", "https?://(www\\.)?elitedisk\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?freakmov\\.com/(rc|video)/[0-9]+", "http://[\\w\\.]*?(shragle|cloudnator)\\.(com|de)/files/[\\w]+/.*", "http://[\\w\\.]*?filesavr\\.com/[A-Za-z0-9]+(_\\d+)?", "http://(www\\.)?saveufile\\.(in\\.th|com)/car\\.php\\?file=[a-z0-9]+", "https?://(www\\.)?migahost\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?fastfreefilehosting\\.com/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "https?://(www\\.)?files2k\\.eu/[a-z0-9]{12}", "https?://(www\\.)?shafiles\\.me/[a-z0-9]{12}", "http://(www\\.)?jalurcepat\\.com/[a-z0-9]{12}", "https?://(www\\.)?(divload|divupload)\\.org/(embed\\-)?[a-z0-9]{12}", "http://(www\\.)?refile\\.net/(d|f)/\\?[\\w]+",
"http://[\\w\\.]*?oron\\.com/[a-z0-9]{12}", "http://(www\\.)?wupload\\.[a-z]{1,5}/file/([0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?)", "http://[\\w\\.]*?(sharingmatrix|filesonic)\\..*?/.*?file/([a-zA-Z0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?|[0-9]+(/.+)?)", "https?://(www\\.)?xxlupload\\.com/[a-z0-9]{12}", "http://(www\\.)?cumfox\\.com/videos/.*?-\\d+\\.html", "http://(www\\.)?pyramidfiles\\.com/[a-z0-9]{12}", "http://(www\\.)?nahraj\\.cz/content/(view|download)/[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+", "http://(www\\.)?jsharer\\.com/download/[a-z0-9]+\\.htm", "https?://(www\\.)?annonhost\\.net/[a-z0-9]{12}", "http://(www\\.)?filekeeper\\.org/download/[0-9a-zA-Z]+/([\\(\\)0-9A-Za-z\\.\\-_% ]+|[/]+/[\\(\\)0-9A-Za-z\\.\\-_% ])", "http://(www\\.)?dynyoo\\.com/\\?goto=dl\\&id=[a-z0-9]{32}", "http://[\\w\\.]*?163pan\\.com/files/[a-z0-9]+\\.html",
"http://[\\w\\.]*?imagehost\\.org/(download/[0-9]+/.+|[0-9]+/.+)", "http://[\\w\\.]*?4us\\.to/download\\.php\\?id=[A-Z0-9]+", "http://[\\w\\.]*?yabadaba\\.ru/files/[0-9]+", "http://(www\\.)?madshare\\.com/(en/)?download/[a-zA-Z0-9]+/", "http://(www\\.)?diglo\\.com/download/[a-z0-9]+", "http://(www\\.)?tubeload\\.to/file(\\d+)?\\-.+", "http://(www\\.)?tunabox\\.net/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?yourfilehost\\.com/media\\.php\\?cat=.*?\\&file=.+", "https?://(www\\.)?uploadegg\\.com/[a-z0-9]{12}", "http://(www\\.)?brsbox\\.com/filebox/down/fc/[a-z0-9]{32}", "http://(www\\.)?amateurboobtube\\.com/videos/\\d+/.*?\\.html", "http://(www\\.)?good\\.net/.+", "http://(www\\.)*?(freeload|mcload)\\.to/(divx\\.php\\?file_id=|\\?Mod=Divx\\&Hash=)[a-z0-9]+", "http://(www\\.)?netporn\\.nl/watch/[a-z0-9]+/.{1}", "http://(www\\.)?przeklej\\.pl/(d/\\w+/|\\d+|plik/)[^\\s]+",
"http://(www\\.)?alldrives\\.ge/main/linkform\\.php\\?f=[a-z0-9]+", "http://(www\\.)?allshares\\.ge/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?holderfile\\.com/[a-z0-9]{12}", "http://(www\\.)?megashare\\.vnn\\.vn/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?link\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\.jeje\\.ge//((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\-4\\.com/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?cloudcache\\.cc/[a-z0-9]{12}", "https?://(www\\.)?(ddlanime\\.com|ddlani\\.me)/[a-z0-9]{12}", "http://(www\\.)?mountfile\\.com/file/[a-z0-9]+/[a-z0-9]+", "http://(www\\.)?platinshare\\.com/files/[A-Za-z0-9]+", "http://(www\\.)?ishare\\.iask\\.sina\\.com\\.cn/f/\\d+\\.html",
"http://(www\\.)?megavideo\\.com/(.*?(v|d)=|v/)[a-zA-Z0-9]+", "http://(www\\.)?megaupload\\.com/.*?(\\?|&)d=[0-9A-Za-z]+", "http://(www\\.)?(cum|megaporn|megarotic|sexuploader)\\.com/(.*?v=|v/)[a-zA-Z0-9]+", "http://(www\\.)?zshare\\.net/(download|video|image|audio|flash)/.*", "http://(www\\.)?uploading4u\\.com/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?megafree\\.kz/file\\d+", "http://(www\\.)?batubia\\.com/[a-z0-9]{12}", "http://(www\\.)?upload24\\.net/[a-z0-9]+\\.[a-z0-9]+", "http://(www\\.)?download\\.files\\.namba\\.kz/files/\\d+", "http://(www\\.)?datumbit\\.com/file/.*?/", "http://(www\\.)?fik1\\.com/[a-z0-9]{12}", "http://(www\\.)?fileape\\.com/(index\\.php\\?act=download\\&id=|dl/)\\w+", "http://(www\\.)?filezzz\\.com/download/[0-9]+/", "http://(www\\.)?imagewaste\\.com/pictures/\\d+/.{1}",
"http://(www\\.)?fyels\\.com/[A-Za-z0-9]+", "http://(www\\.)?gotupload\\.com/[a-z0-9]{12}", "http://(go.sharehub.com|sharehub.me|follow.to|kgt.com|krt.com)/.*", "http://(www\\.)?sharehut\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(filesurf|4ppl|files\\.youmama)\\.ru/[0-9]+", "http://[\\w\\.]*?openfile\\.ru/[0-9]+", "http://[\\w\\.]*?letitfile\\.(ru|com)/download/id\\d+", "http://[\\w\\.]*?tab\\.net\\.ua/sites/files/site_name\\..*?/id\\.\\d+/", "http://[\\w\\.]*?uploadbox\\.com/.*?files/[0-9a-zA-Z]+", "http://(www\\.)?supashare\\.net/[a-z0-9]{12}", "https?://(www\\.)?usershare\\.net/[a-z0-9]{12}", "http://(www\\.)?skipfile\\.com/[a-z0-9]{12}", "http://(www\\.)?10upload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?x7\\.to/(?!list)[a-zA-Z0-9]+(/(?!inList)[^/\r\n]+)?", "http://(www\\.)?multiuploaddecrypted\\.com/([A-Z0-9]{2}_[A-Z0-9]+|[0-9A-Z]+)", "http://(www\\.)?uploadking\\.com/[A-Z0-9]+",
"http://(www\\.)?uploadhere\\.com/[A-Z0-9]+", "http://[\\w\\.]*?fileshaker\\.com/.+", "http://(www\\.)?vistaupload\\.com/[a-z0-9]{12}", "https?://(www\\.)?groovefile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?enterupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?xshareware\\.com/[\\w]+/.*", "http://[\\w\\.]*?xun6\\.(com|net)/file/[a-z0-9]+", "http://(www\\.)?yourupload\\.de/[a-z0-9]{12}", "http://(www\\.)?youshare\\.eu/[a-z0-9]{12}", "http://(www\\.)?mafiaupload\\.com/do\\.php\\?id=\\d+", "http://[\\w\\.]*?addat.hu/.+/.+", "http://(www\\.)?archiv\\.to/((\\?Module\\=Details\\&HashID\\=|GET/)FILE[A-Z0-9]+|view/divx/[a-z0-9]+)", "http://[\\w\\.]*?bigupload\\.com/(d=|files/)[A-Z0-9]+", "http://(www\\.)?biggerupload\\.com/[a-z0-9]{12}", "http://(www\\.)?(bitload\\.com/(f|d)/\\d+/[a-z0-9]+|mystream\\.to/file-\\d+-[a-z0-9]+)", "https?://(www\\.)?bufiles\\.com/[a-z0-9]{12}",
"http://(www\\.)?cash-file\\.(com|net)/[a-z0-9]{12}", "http://[\\w\\.]*?combozip\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(duckload\\.com|youload\\.to)/(download/[a-z0-9]+|(divx|play)/[A-Z0-9\\.-]+|[a-zA-Z0-9\\.]+)", "http://(www\\.)?exoshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?file2upload\\.(net|com)/download/[0-9]+/", "http://[\\w\\.]*?filebase\\.to/(files|download)/\\d{1,}/.*", "http://[\\w\\.]*?filebling\\.com/[a-z0-9]{12}", "http://(www\\.)?filecrown\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?filefrog\\.to/download/\\d+/[a-zA-Z0-9]+", "http://[\\w\\.]*?filefront\\.com/[0-9]+", "http://(www\\.)?filehook\\.com/[a-z0-9]{12}", "http://(www\\.)?filestage\\.to/watch/[a-z0-9]+/", "http://(www\\.)?(filezup|divxupfile)\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?fullshare\\.net/show/[a-z0-9]+/.+", "http://(www\\.)?gaiafile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?keepfile\\.com/[a-z0-9]{12}",
"http://[\\w\\.]*?kewlshare\\.com/dl/[\\w]+/", "http://[\\w\\.]*?lizshare\\.net/[a-z0-9]{12}", "http://(www\\.)?loaded\\.it/(show/[a-z0-9]+/[A-Za-z0-9_\\-% \\.]+|(flash|divx)/[a-z0-9]+/)", "http://[\\w\\.]*?loadfiles\\.in/[a-z0-9]{12}", "(http://[\\w\\.]*?megarapid\\.eu/files/\\d+/.+)|(http://[\\w\\.]*?megarapid\\.eu/\\?e=403\\&m=captcha\\&file=\\d+/.+)", "http://[\\w\\.]*?(megashare\\.vn/(download\\.php\\?uid=[0-9]+\\&id=[0-9]+|dl\\.php/\\d+)|share\\.megaplus\\.vn/dl\\.php/\\d+)", "http://(www\\.)?metahyper\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?missupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?netstorer\\.com/[a-zA-Z0-9]+/.+", "http://[\\w\\.]*?nextgenvidz\\.com/view/\\d+", "http://(www\\.)?piggyshare\\.com/file/[a-z0-9]+", "http://(www\\.)?profitupload\\.com/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?quickload\\.to/\\?Go=Player\\&HashID=FILE[A-Z0-9]+",
"http://[\\w\\.]*?quickyshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?share\\.cx/(files/)?\\d+", "http://[\\w\\.]*?sharehoster\\.(de|com|net)/(dl|wait|vid)/[a-z0-9]+", "http://[\\w\\.]*?shareua.com/get_file/.*?/\\d+", "http://[\\w\\.]*?speedload\\.to/FILE[A-Z0-9]+", "http://(www\\.)?upfile\\.in/[a-z0-9]{12}", "http://[\\w\\.]*?ugotfile.com/file/\\d+/.+", "http://[\\w\\.]*?upload\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://[\\w\\.]*?uploadmachine\\.com/(download\\.php\\?id=[0-9]+&type=[0-9]{1}|file/[0-9]+/)", "http://[\\w\\.]*?uploady\\.to/dl/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?uploadstore\\.net/[a-z0-9]{12}", "http://[\\w\\.]*?vspace\\.cc/file/[A-Z0-9]+\\.html", "http://[\\w\\.]*?web-share\\.net/download/file/item/.*?_[0-9]+", "http://(www\\.)?yvh\\.cc/video\\.php\\?file=[a-z0-9_]+",
"http://[\\w\\.]*?x-files\\.kz/[a-z0-9]+" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "uploadville.com", "fileserver.cc", "bebasupload.com", "savefile.ro", "ovfile.com", "divxbase.com", "gptfile.com", "dudupload.com", "eyvx.com", "farshare.to", "azsharing.com", "freefilessharing.com", "elitedisk.com", "freakmov.com", "cloudnator.com", "filesavr.com", "saveufile.in.th", "migahost.com", "fastfreefilehosting.com", "files2k.eu", "shafiles.me", "jalurcepat.com", "divload.org", "refile.net", "oron.com", "wupload.com", "filesonic.com", "xxlupload.com", "cumfox.com", "pyramidfiles.com", "nahraj.cz", "jsharer.com", "annonhost.net", "filekeeper.org", "dynyoo.com", "163pan.com", "imagehost.org", "4us.to", "yabadaba.ru", "madshare.com", "diglo.com", "tubeload.to", "tunabox.net", "yourfilehost.com", "uploadegg.com", "brsbox.com", "amateurboobtube.com", "good.net", "freeload.to", "netporn.nl", "przeklej.pl",
"alldrives.ge", "allshares.ge", "holderfile.com", "megashare.vnn.vn", "link.ge", "up.jeje.ge", "up-4.com", "cloudcache", "ddlanime.com", "mountfile.com", "platinshare.com", "ishare.iask.sina.com.cn", "megavideo.com", "megaupload.com", "cum.com", "zshare.net", "uploading4u.com", "megafree.kz", "batubia.com", "upload24.net", "files.namba.kz", "datumbit.com", "fik1.com", "fileape.com", "filezzz.com", "imagewaste.com", "fyels.com", "gotupload.com", "sharehub.com", "sharehut.com", "filesurf.ru", "openfile.ru", "letitfile.ru", "tab.net.ua", "uploadbox.com", "supashare.net", "usershare.net", "skipfile.com", "10upload.com", "x7.to", "multiupload.com", "uploadking.com", "uploadhere.com", "fileshaker.com", "vistaupload.com", "groovefile.com", "enterupload.com", "xshareware.com", "xun6.com", "yourupload.de", "youshare.eu", "mafiaupload.com", "addat.hu", "archiv.to", "bigupload.com",
"biggerupload.com", "bitload.com", "bufiles.com", "cash-file.net", "combozip.com", "duckload.com", "exoshare.com", "file2upload.net", "filebase.to", "filebling.com", "filecrown.com", "filefrog.to", "filefront.com", "filehook.com", "filestage.to", "filezup.com", "fullshare.net", "gaiafile.com", "keepfile.com", "kewlshare.com", "lizshare.net", "loaded.it", "loadfiles.in", "megarapid.eu", "megashare.vn", "metahyper.com", "missupload.com", "netstorer.com", "nextgenvidz.com", "piggyshare.com", "profitupload.com", "quickload.to", "quickyshare.com", "share.cx", "sharehoster.de", "shareua.com", "speedload.to", "upfile.in", "ugotfile.com", "upload.ge", "uploadmachine.com", "uploady.to", "uploadstore.net", "vspace.cc", "web-share.net", "yvh.cc", "x-files.kz" }, urls = { "http://(www\\.)?uploadville\\.com/[a-z0-9]{12}", "http://(www\\.)?fileserver\\.cc/[a-z0-9]{12}",
"http://(www\\.)?bebasupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?savefile\\.ro/[\\w]+/?", "http://(www\\.)?ovfile\\.com/[a-z0-9]{12}", "https?://(www\\.)?divxbase\\.com/[a-z0-9]{12}", "https?://(www\\.)?gptfile\\.com/[a-z0-9]{12}", "https?://(www\\.)?dudupload\\.com/[a-z0-9]{12}", "http://(www\\.)?eyvx\\.com/[a-z0-9]{12}", "http://(www\\.)?farshare\\.to/[a-z0-9]{12}", "http://(www\\.)?azsharing\\.com/[a-z0-9]{12}/", "http://(www\\.)?freefilessharing\\.com/[a-z0-9]{12}", "https?://(www\\.)?elitedisk\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?freakmov\\.com/(rc|video)/[0-9]+", "http://[\\w\\.]*?(shragle|cloudnator)\\.(com|de)/files/[\\w]+/.*", "http://[\\w\\.]*?filesavr\\.com/[A-Za-z0-9]+(_\\d+)?", "http://(www\\.)?saveufile\\.(in\\.th|com)/car\\.php\\?file=[a-z0-9]+", "https?://(www\\.)?migahost\\.com/[a-z0-9]{12}",
"http://[\\w\\.]*?fastfreefilehosting\\.com/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "https?://(www\\.)?files2k\\.eu/[a-z0-9]{12}", "https?://(www\\.)?shafiles\\.me/[a-z0-9]{12}", "http://(www\\.)?jalurcepat\\.com/[a-z0-9]{12}", "https?://(www\\.)?(divload|divupload)\\.org/(embed\\-)?[a-z0-9]{12}", "http://(www\\.)?refile\\.net/(d|f)/\\?[\\w]+", "http://[\\w\\.]*?oron\\.com/[a-z0-9]{12}", "http://(www\\.)?wupload\\.[a-z]{1,5}/file/([0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?)", "http://[\\w\\.]*?(sharingmatrix|filesonic)\\..*?/.*?file/([a-zA-Z0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?|[0-9]+(/.+)?)", "https?://(www\\.)?xxlupload\\.com/[a-z0-9]{12}", "http://(www\\.)?cumfox\\.com/videos/.*?-\\d+\\.html", "http://(www\\.)?pyramidfiles\\.com/[a-z0-9]{12}", "http://(www\\.)?nahraj\\.cz/content/(view|download)/[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+\\-[a-z0-9]+",
"http://(www\\.)?jsharer\\.com/download/[a-z0-9]+\\.htm", "https?://(www\\.)?annonhost\\.net/[a-z0-9]{12}", "http://(www\\.)?filekeeper\\.org/download/[0-9a-zA-Z]+/([\\(\\)0-9A-Za-z\\.\\-_% ]+|[/]+/[\\(\\)0-9A-Za-z\\.\\-_% ])", "http://(www\\.)?dynyoo\\.com/\\?goto=dl\\&id=[a-z0-9]{32}", "http://[\\w\\.]*?163pan\\.com/files/[a-z0-9]+\\.html", "http://[\\w\\.]*?imagehost\\.org/(download/[0-9]+/.+|[0-9]+/.+)", "http://[\\w\\.]*?4us\\.to/download\\.php\\?id=[A-Z0-9]+", "http://[\\w\\.]*?yabadaba\\.ru/files/[0-9]+", "http://(www\\.)?madshare\\.com/(en/)?download/[a-zA-Z0-9]+/", "http://(www\\.)?diglo\\.com/download/[a-z0-9]+", "http://(www\\.)?tubeload\\.to/file(\\d+)?\\-.+", "http://(www\\.)?tunabox\\.net/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?yourfilehost\\.com/media\\.php\\?cat=.*?\\&file=.+", "https?://(www\\.)?uploadegg\\.com/[a-z0-9]{12}",
"http://(www\\.)?brsbox\\.com/filebox/down/fc/[a-z0-9]{32}", "http://(www\\.)?amateurboobtube\\.com/videos/\\d+/.*?\\.html", "http://(www\\.)?good\\.net/.+", "http://(www\\.)*?(freeload|mcload)\\.to/(divx\\.php\\?file_id=|\\?Mod=Divx\\&Hash=)[a-z0-9]+", "http://(www\\.)?netporn\\.nl/watch/[a-z0-9]+/.{1}", "http://(www\\.)?przeklej\\.pl/(d/\\w+/|\\d+|plik/)[^\\s]+", "http://(www\\.)?alldrives\\.ge/main/linkform\\.php\\?f=[a-z0-9]+", "http://(www\\.)?allshares\\.ge/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?holderfile\\.com/[a-z0-9]{12}", "http://(www\\.)?megashare\\.vnn\\.vn/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?link\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?up\\.jeje\\.ge//((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)",
"http://(www\\.)?up\\-4\\.com/(\\?d|download\\.php\\?id)=[A-Z0-9]+", "https?://(www\\.)?cloudcache\\.cc/[a-z0-9]{12}", "https?://(www\\.)?(ddlanime\\.com|ddlani\\.me)/[a-z0-9]{12}", "http://(www\\.)?mountfile\\.com/file/[a-z0-9]+/[a-z0-9]+", "http://(www\\.)?platinshare\\.com/files/[A-Za-z0-9]+", "http://(www\\.)?ishare\\.iask\\.sina\\.com\\.cn/f/\\d+\\.html", "http://(www\\.)?megavideo\\.com/(.*?(v|d)=|v/)[a-zA-Z0-9]+", "http://(www\\.)?megaupload\\.com/.*?(\\?|&)d=[0-9A-Za-z]+", "http://(www\\.)?(cum|megaporn|megarotic|sexuploader)\\.com/(.*?v=|v/)[a-zA-Z0-9]+", "http://(www\\.)?zshare\\.net/(download|video|image|audio|flash)/.*", "http://(www\\.)?uploading4u\\.com/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?megafree\\.kz/file\\d+", "http://(www\\.)?batubia\\.com/[a-z0-9]{12}", "http://(www\\.)?upload24\\.net/[a-z0-9]+\\.[a-z0-9]+",
"http://(www\\.)?download\\.files\\.namba\\.kz/files/\\d+", "http://(www\\.)?datumbit\\.com/file/.*?/", "http://(www\\.)?fik1\\.com/[a-z0-9]{12}", "http://(www\\.)?fileape\\.com/(index\\.php\\?act=download\\&id=|dl/)\\w+", "http://(www\\.)?filezzz\\.com/download/[0-9]+/", "http://(www\\.)?imagewaste\\.com/pictures/\\d+/.{1}", "http://(www\\.)?fyels\\.com/[A-Za-z0-9]+", "http://(www\\.)?gotupload\\.com/[a-z0-9]{12}", "http://(go.sharehub.com|sharehub.me|follow.to|kgt.com|krt.com)/.*", "http://(www\\.)?sharehut\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(filesurf|4ppl|files\\.youmama)\\.ru/[0-9]+", "http://[\\w\\.]*?openfile\\.ru/[0-9]+", "http://[\\w\\.]*?letitfile\\.(ru|com)/download/id\\d+", "http://[\\w\\.]*?tab\\.net\\.ua/sites/files/site_name\\..*?/id\\.\\d+/", "http://[\\w\\.]*?uploadbox\\.com/.*?files/[0-9a-zA-Z]+", "http://(www\\.)?supashare\\.net/[a-z0-9]{12}",
"https?://(www\\.)?usershare\\.net/[a-z0-9]{12}", "http://(www\\.)?skipfile\\.com/[a-z0-9]{12}", "http://(www\\.)?10upload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?x7\\.to/(?!list)[a-zA-Z0-9]+(/(?!inList)[^/\r\n]+)?", "http://(www\\.)?multiuploaddecrypted\\.com/([A-Z0-9]{2}_[A-Z0-9]+|[0-9A-Z]+)", "http://(www\\.)?uploadking\\.com/[A-Z0-9]+", "http://(www\\.)?uploadhere\\.com/[A-Z0-9]+", "http://[\\w\\.]*?fileshaker\\.com/.+", "http://(www\\.)?vistaupload\\.com/[a-z0-9]{12}", "https?://(www\\.)?groovefile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?enterupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?xshareware\\.com/[\\w]+/.*", "http://[\\w\\.]*?xun6\\.(com|net)/file/[a-z0-9]+", "http://(www\\.)?yourupload\\.de/[a-z0-9]{12}", "http://(www\\.)?youshare\\.eu/[a-z0-9]{12}", "http://(www\\.)?mafiaupload\\.com/do\\.php\\?id=\\d+", "http://[\\w\\.]*?addat.hu/.+/.+",
"http://(www\\.)?archiv\\.to/((\\?Module\\=Details\\&HashID\\=|GET/)FILE[A-Z0-9]+|view/divx/[a-z0-9]+)", "http://[\\w\\.]*?bigupload\\.com/(d=|files/)[A-Z0-9]+", "http://(www\\.)?biggerupload\\.com/[a-z0-9]{12}", "http://(www\\.)?(bitload\\.com/(f|d)/\\d+/[a-z0-9]+|mystream\\.to/file-\\d+-[a-z0-9]+)", "https?://(www\\.)?bufiles\\.com/[a-z0-9]{12}", "http://(www\\.)?cash-file\\.(com|net)/[a-z0-9]{12}", "http://[\\w\\.]*?combozip\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?(duckload\\.com|youload\\.to)/(download/[a-z0-9]+|(divx|play)/[A-Z0-9\\.-]+|[a-zA-Z0-9\\.]+)", "http://(www\\.)?exoshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?file2upload\\.(net|com)/download/[0-9]+/", "http://[\\w\\.]*?filebase\\.to/(files|download)/\\d{1,}/.*", "http://[\\w\\.]*?filebling\\.com/[a-z0-9]{12}", "http://(www\\.)?filecrown\\.com/[a-z0-9]{12}",
"http://[\\w\\.]*?filefrog\\.to/download/\\d+/[a-zA-Z0-9]+", "http://[\\w\\.]*?filefront\\.com/[0-9]+", "http://(www\\.)?filehook\\.com/[a-z0-9]{12}", "http://(www\\.)?filestage\\.to/watch/[a-z0-9]+/", "http://(www\\.)?(filezup|divxupfile)\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?fullshare\\.net/show/[a-z0-9]+/.+", "http://(www\\.)?gaiafile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?keepfile\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?kewlshare\\.com/dl/[\\w]+/", "http://[\\w\\.]*?lizshare\\.net/[a-z0-9]{12}", "http://(www\\.)?loaded\\.it/(show/[a-z0-9]+/[A-Za-z0-9_\\-% \\.]+|(flash|divx)/[a-z0-9]+/)", "http://[\\w\\.]*?loadfiles\\.in/[a-z0-9]{12}", "(http://[\\w\\.]*?megarapid\\.eu/files/\\d+/.+)|(http://[\\w\\.]*?megarapid\\.eu/\\?e=403\\&m=captcha\\&file=\\d+/.+)",
"http://[\\w\\.]*?(megashare\\.vn/(download\\.php\\?uid=[0-9]+\\&id=[0-9]+|dl\\.php/\\d+)|share\\.megaplus\\.vn/dl\\.php/\\d+)", "http://(www\\.)?metahyper\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?missupload\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?netstorer\\.com/[a-zA-Z0-9]+/.+", "http://[\\w\\.]*?nextgenvidz\\.com/view/\\d+", "http://(www\\.)?piggyshare\\.com/file/[a-z0-9]+", "http://(www\\.)?profitupload\\.com/files/[A-Za-z0-9]+\\.html", "http://[\\w\\.]*?quickload\\.to/\\?Go=Player\\&HashID=FILE[A-Z0-9]+", "http://[\\w\\.]*?quickyshare\\.com/[a-z0-9]{12}", "http://[\\w\\.]*?share\\.cx/(files/)?\\d+", "http://[\\w\\.]*?sharehoster\\.(de|com|net)/(dl|wait|vid)/[a-z0-9]+", "http://[\\w\\.]*?shareua.com/get_file/.*?/\\d+", "http://[\\w\\.]*?speedload\\.to/FILE[A-Z0-9]+", "http://(www\\.)?upfile\\.in/[a-z0-9]{12}", "http://[\\w\\.]*?ugotfile.com/file/\\d+/.+",
"http://[\\w\\.]*?upload\\.ge/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://[\\w\\.]*?uploadmachine\\.com/(download\\.php\\?id=[0-9]+&type=[0-9]{1}|file/[0-9]+/)", "http://[\\w\\.]*?uploady\\.to/dl/((\\?d|download\\.php\\?id)=[A-Z0-9]+|((en|ru|fr|es)/)?file/[0-9]+/)", "http://(www\\.)?uploadstore\\.net/[a-z0-9]{12}", "http://[\\w\\.]*?vspace\\.cc/file/[A-Z0-9]+\\.html", "http://[\\w\\.]*?web-share\\.net/download/file/item/.*?_[0-9]+", "http://(www\\.)?yvh\\.cc/video\\.php\\?file=[a-z0-9_]+", "http://[\\w\\.]*?x-files\\.kz/[a-z0-9]+" }, flags = { 0 })
public class Offline extends PluginForHost {
public Offline(PluginWrapper wrapper) {

View File

@ -1,460 +0,0 @@
//jDownloader - Downloadmanager
//Copyright (C) 2011 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "ovfile.com" }, urls = { "http://(www\\.)?ovfile\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class OvFileCom extends PluginForHost {
private String BRBEFORE = "";
private static final String PASSWORDTEXT = "(<br><b>Password:</b> <input|<br><b>Passwort:</b> <input)";
private static final String COOKIE_HOST = "http://ovfile.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String MAINTENANCEUSERTEXT = "This server is under Maintenance";
public OvFileCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(BRBEFORE, PASSWORDTEXT).matches() || BRBEFORE.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
throw new PluginException(LinkStatus.ERROR_RETRY, "Wrong password entered");
}
if (BRBEFORE.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (BRBEFORE.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
// Some waittimes...
if (BRBEFORE.contains("You have to wait")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = new Regex(BRBEFORE, "You have to wait.*?\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
if (waittime != 0) {
logger.info("Detected waittime #1, waiting " + waittime + " milliseconds");
// Not enough waittime to reconnect->Wait and try again
if (waittime < 120000) {
sleep(waittime, theLink);
throw new PluginException(LinkStatus.ERROR_RETRY);
}
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
}
}
if (BRBEFORE.contains("You have reached the download-limit")) {
String tmphrs = new Regex(BRBEFORE, "\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(BRBEFORE, "\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(BRBEFORE, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(BRBEFORE, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
// Not enough waittime to reconnect->Wait and try again
if (waittime < 120000) {
sleep(waittime, theLink);
throw new PluginException(LinkStatus.ERROR_RETRY);
}
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (BRBEFORE.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (BRBEFORE.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
// Errorhandling for only-premium links
if (new Regex(BRBEFORE, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file You requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(BRBEFORE, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium or registered");
}
}
if (BRBEFORE.contains(MAINTENANCE)) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT), 2 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (new Regex(BRBEFORE, Pattern.compile("No file", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(BRBEFORE, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private String decodeDownloadLink(String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
return finallink;
}
public void doFree(DownloadLink downloadLink, boolean resumable, int maxchunks, boolean checkFastWay) throws Exception, PluginException {
String passCode = null;
String md5hash = new Regex(BRBEFORE, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
String dllink = null;
if (checkFastWay) {
dllink = downloadLink.getStringProperty("freelink");
if (dllink != null) {
try {
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = br2.openGetConnection(dllink);
if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
downloadLink.setProperty("freelink", Property.NULL);
dllink = null;
}
con.disconnect();
} catch (Exception e) {
dllink = null;
}
}
}
// Videolinks can already be found here, if a link is found here we can
// skip waittimes and captchas
if (dllink == null) {
checkErrors(downloadLink, false, passCode);
if (BRBEFORE.contains("\"download1\"")) {
br.postPage(downloadLink.getDownloadURL(), "op=download1&usr_login=&id=" + new Regex(downloadLink.getDownloadURL(), COOKIE_HOST.replace("http://", "") + "/" + "([a-z0-9]{12})").getMatch(0) + "&fname=" + Encoding.urlEncode(downloadLink.getName()) + "&referer=&method_free=Free+Download");
doSomething();
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
}
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(BRBEFORE, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* Captcha START */
if (BRBEFORE.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
// Captcha method by ManiacMansion
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (BRBEFORE.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode("xfilesharingprobasic", captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(BRBEFORE, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.setForm(dlForm);
String id = this.br.getRegex("\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
// waittime is often skippable for reCaptcha handling
// skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
br.submitForm(dlForm);
logger.info("Submitted DLForm");
doSomething();
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
doSomething();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
downloadLink.setProperty("freelink", dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
dl.startDownload();
}
// Removed fake messages which can kill the plugin
public void doSomething() throws NumberFormatException, PluginException {
BRBEFORE = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
BRBEFORE = BRBEFORE.replace(fun, "");
}
}
// XfileSharingProBasic Version 2.5.0.7
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(BRBEFORE, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(BRBEFORE, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(BRBEFORE, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = br.getRegex("p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
return dllink;
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return 1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, true, 1, true);
}
public String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
passCode = thelink.getStringProperty("pass", null);
if (passCode == null) passCode = Plugin.getUserInput("Password?", thelink);
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return Encoding.urlEncode(passCode);
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.setFollowRedirects(false);
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(link.getDownloadURL());
doSomething();
if (new Regex(BRBEFORE, Pattern.compile("(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (BRBEFORE.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;
}
String filename = new Regex(BRBEFORE, "You have requested.*?http://(www\\.)?" + COOKIE_HOST.replace("http://", "") + "/[a-z0-9]{12}/(.*?)</font>").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (filename == null) {
filename = new Regex(BRBEFORE, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(BRBEFORE, "File Name.*?nowrap>(.*?)</td").getMatch(0);
}
}
}
}
}
String filesize = new Regex(BRBEFORE, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
filesize = new Regex(BRBEFORE, "<small>\\((.*?)\\)</small>").getMatch(0);
if (filesize == null) {
filesize = new Regex(BRBEFORE, "</font>[ ]+\\((.*?)\\)(.*?)</font>").getMatch(0);
if (filesize == null) filesize = new Regex(BRBEFORE, "<b>Size:\\&nbsp;</b></td><td>(.*?)\\&nbsp;\\|").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (BRBEFORE.contains("You have reached the download-limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(filename.trim());
if (filesize != null && !filesize.equals("")) link.setDownloadSize(SizeFormatter.getSize(filesize));
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
private void waitTime(long timeBefore, DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
// Ticket Time
String ttt = new Regex(BRBEFORE, "countdown\">.*?(\\d+).*?</span>").getMatch(0);
if (ttt == null) ttt = new Regex(BRBEFORE, "id=\"countdown_str\".*?<span id=\".*?\">.*?(\\d+).*?</span").getMatch(0);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1000l, downloadLink);
}
}
}

View File

@ -68,7 +68,7 @@ public class PreFilesCom extends PluginForHost {
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
private static AtomicInteger maxPrem = new AtomicInteger(1);
private static Object LOCK = new Object();
private static Object LOCK = new Object();
// DEV NOTES
/**
@ -122,7 +122,7 @@ public class PreFilesCom extends PluginForHost {
br.setFollowRedirects(false);
prepBrowser();
getPage(link.getDownloadURL());
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, ">The file you were looking for could not be found").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (correctedBR.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;
@ -158,36 +158,10 @@ public class PreFilesCom extends PluginForHost {
private String[] scanInfo(String[] fileInfo) {
// standard traits from base page
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Download File:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// traits from download1 page below.
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// next two are details from sharing box
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+>(.+) \\- [\\d\\.]+ (KB|MB|GB)</a></textarea>[\r\n\t ]+</div>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+\\](.+) \\- [\\d\\.]+ (KB|MB|GB)\\[/URL\\]").getMatch(0);
}
}
}
}
}
}
fileInfo[0] = new Regex(correctedBR, "<div class=\"filename_bar\"><h2>([^<>\"]*?)<small>").getMatch(0);
}
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "([\\d\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
fileInfo[1] = new Regex(correctedBR, "<small>\\(([^<>\"]*?)\\)</small>").getMatch(0);
}
if (fileInfo[2] == null) fileInfo[2] = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
return fileInfo;
@ -386,33 +360,7 @@ public class PreFilesCom extends PluginForHost {
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(correctedBR, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>(Click to Download|Download File)").getMatch(0);
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
}
dllink = new Regex(correctedBR, "\"(http://srv\\d+\\.prefiles\\.com(:\\d+)?/files/\\d+/[a-z0-9]+/[^<>\"]*?)\"").getMatch(0);
}
return dllink;
}

View File

@ -31,7 +31,7 @@ import jd.plugins.PluginForHost;
import org.appwork.utils.formatter.SizeFormatter;
//rghost.ru by pspzockerscene
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "rghost.ru" }, urls = { "http://(www\\.)?(rghost\\.net|rghost\\.ru|phonon\\.rghost\\.ru)/([0-9]+/private/[a-z0-9]+|download/[0-9]+|[0-9]+(\\?key=[a-z0-9]+)?)" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "rghost.ru" }, urls = { "http://(www\\.)?((tr\\.)?rghost\\.net|rghost\\.ru|phonon\\.rghost\\.ru)/([0-9]+/private/[a-z0-9]+|download/[0-9]+|[0-9]+(\\?key=[a-z0-9]+)?)" }, flags = { 0 })
public class RGhostRu extends PluginForHost {
private static final String PWTEXT = "Password: <input id=\"password\" name=\"password\" type=\"password\"";
@ -53,6 +53,10 @@ public class RGhostRu extends PluginForHost {
return -1;
}
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("tr.rghost.net/", "rghost.net/"));
}
@Override
public void handleFree(DownloadLink link) throws Exception {
requestFileInformation(link);

View File

@ -1,129 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2008 JD-Team support@jdownloader.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.IOException;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.html.Form;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "savefile.ro" }, urls = { "http://[\\w\\.]*?savefile\\.ro/[\\w]+/?" }, flags = { 0 })
public class SavefileRo extends PluginForHost {
public SavefileRo(PluginWrapper wrapper) {
super(wrapper);
}
@Override
public String getAGBLink() {
return "http://www.savefile.ro/tos.html";
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return -1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception {
requestFileInformation(downloadLink);
br.setFollowRedirects(false);
br.setDebug(true);
if (br.containsHTML("You have reached")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = br.getRegex("\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = br.getRegex("\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = br.getRegex("\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
} else {
Form form = br.getFormbyProperty("name", "F1");
if (form == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
String captchaurl = br.getRegex(Pattern.compile("below:</div></b></td></tr>\\s+<tr><td><img src=\"(.*?)\"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)).getMatch(0);
String code = getCaptchaCode(captchaurl, downloadLink);
form.put("code", code);
form.setAction(downloadLink.getDownloadURL());
// Ticket Time
int tt = Integer.parseInt(br.getRegex("countdown\">(\\d+)</span>").getMatch(0));
sleep(tt * 1001, downloadLink);
br.submitForm(form);
URLConnectionAdapter con2 = br.getHttpConnection();
String dllink = br.getRedirectLocation();
if (con2.getContentType().contains("html")) {
String error = br.getRegex("class=\"err\"\\s+color=\"#ffffff\">(.*?)</font>").getMatch(0);
if (error != null) {
logger.warning(error);
con2.disconnect();
if (error.equalsIgnoreCase("Wrong captcha") || error.equalsIgnoreCase("Expired session")) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
} else {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, error, 10000);
}
}
if (br.containsHTML("Download Link Generated")) dllink = br.getRegex("Download:</font><br>\\s+<a\\s+href=\"(.*?)\"\\s+class").getMatch(0);
}
if (dllink == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, false, 1);
dl.startDownload();
}
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
this.setBrowserExclusive();
br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("No such file")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = Encoding.htmlDecode(br.getRegex("File\\s+Name:</b></td><td\\s+nowrap>(.*?)</b>").getMatch(0));
String filesize = br.getRegex("File\\s+Size:</b></td><td>(.*?)\\s+<small>").getMatch(0);
if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
downloadLink.setName(filename);
downloadLink.setDownloadSize(SizeFormatter.getSize(filesize));
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
@Override
public void resetPluginGlobals() {
}
}

View File

@ -29,7 +29,7 @@ import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "tu.tv" }, urls = { "http://(www\\.)?tu\\.tv/videos/[a-z0-9-]+" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "tu.tv" }, urls = { "http://(www\\.)?tu\\.tv/videos/[a-z0-9\\-_]+" }, flags = { 0 })
public class TuTv extends PluginForHost {
private String DLLINK = null;

View File

@ -0,0 +1,187 @@
//jDownloader - Downloadmanager
//Copyright (C) 2009 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Cookie;
import jd.http.Cookies;
import jd.nutils.encoding.Encoding;
import jd.plugins.Account;
import jd.plugins.AccountInfo;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "uploadlux.com" }, urls = { "http://(www\\.)?uploadlux\\.com/l\\-[a-z0-9]+" }, flags = { 2 })
public class UploadLuxCom extends PluginForHost {
public UploadLuxCom(PluginWrapper wrapper) {
super(wrapper);
this.enablePremium("http://uploadlux.com/premium");
}
@Override
public String getAGBLink() {
return "http://www.uploadlux.com/conditions";
}
@Override
public AvailableStatus requestFileInformation(final DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.setCookie(MAINPAGE, "lang", "en");
br.getPage(link.getDownloadURL());
if (br.containsHTML(">Erreur fichier introuvable")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("<b>Filename:</b> <b title=\"([^<>\"]*?)\"").getMatch(0);
String filesize = br.getRegex("<b>File Size:</b> <b style=\"color:#2BB2E3\">([^<>\"]*?)</b><br").getMatch(0);
if (filename == null || filesize == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
link.setName(Encoding.htmlDecode(filename.trim()));
link.setDownloadSize(SizeFormatter.getSize(filesize));
return AvailableStatus.TRUE;
}
@Override
public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
br.setFollowRedirects(false);
final String waittime = br.getRegex("style=\"font\\-size:30px; text\\-decoration:none;\">(\\d+)</span><br />").getMatch(0);
int wait = 60;
if (waittime != null) wait = Integer.parseInt(waittime);
sleep(wait * 1001l, downloadLink);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, downloadLink.getDownloadURL().replace("uploadlux.com/l", "uploadlux.com/lf"), false, 1);
if (dl.getConnection().getContentType().contains("html")) {
br.followConnection();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl.startDownload();
}
private static final String MAINPAGE = "http://uploadlux.com";
private static Object LOCK = new Object();
@SuppressWarnings("unchecked")
private void login(final Account account, final boolean force) throws Exception {
synchronized (LOCK) {
try {
// Load cookies
br.setCookiesExclusive(true);
final Object ret = account.getProperty("cookies", null);
boolean acmatch = Encoding.urlEncode(account.getUser()).equals(account.getStringProperty("name", Encoding.urlEncode(account.getUser())));
if (acmatch) acmatch = Encoding.urlEncode(account.getPass()).equals(account.getStringProperty("pass", Encoding.urlEncode(account.getPass())));
if (acmatch && ret != null && ret instanceof HashMap<?, ?> && !force) {
final HashMap<String, String> cookies = (HashMap<String, String>) ret;
if (account.isValid()) {
for (final Map.Entry<String, String> cookieEntry : cookies.entrySet()) {
final String key = cookieEntry.getKey();
final String value = cookieEntry.getValue();
this.br.setCookie(MAINPAGE, key, value);
}
return;
}
}
br.setFollowRedirects(false);
br.postPage("http://uploadlux.com/connexion", "souvenir=on&connexion=Log+in&email=" + Encoding.urlEncode(account.getUser()) + "&password=" + Encoding.urlEncode(account.getPass()));
if (br.getCookie(MAINPAGE, "session_save") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
br.getPage("http://www.uploadlux.com/profil");
if (!br.containsHTML("<b style=\"color: #FF3300\">Premium</b>")) {
logger.info("This is not a premium account!");
throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
}
// Save cookies
final HashMap<String, String> cookies = new HashMap<String, String>();
final Cookies add = this.br.getCookies(MAINPAGE);
for (final Cookie c : add.getCookies()) {
cookies.put(c.getKey(), c.getValue());
}
account.setProperty("name", Encoding.urlEncode(account.getUser()));
account.setProperty("pass", Encoding.urlEncode(account.getPass()));
account.setProperty("cookies", cookies);
} catch (final PluginException e) {
account.setProperty("cookies", Property.NULL);
throw e;
}
}
}
@Override
public AccountInfo fetchAccountInfo(final Account account) throws Exception {
AccountInfo ai = new AccountInfo();
try {
login(account, true);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
String space = br.getRegex("<b>([^<>\"]*?)</b> on <b>").getMatch(0);
if (space != null) ai.setUsedSpace(space.trim());
ai.setUnlimitedTraffic();
final String expire = br.getRegex("<td> \\- (\\d{2}/\\d{2}/\\d{4})</td><td><a href=\"index\\.php\\?id=premium\\.php\"").getMatch(0);
if (expire == null) {
account.setValid(false);
return ai;
} else {
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "MM/dd/yyyy", Locale.ENGLISH));
}
account.setValid(true);
ai.setStatus("Premium User");
return ai;
}
@Override
public void handlePremium(final DownloadLink link, final Account account) throws Exception {
requestFileInformation(link);
login(account, false);
br.setFollowRedirects(false);
dl = jd.plugins.BrowserAdapter.openDownload(br, link, link.getDownloadURL().replace("uploadlux.com/l", "uploadlux.com/lf"), false, 1);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl.startDownload();
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
return -1;
}
@Override
public void reset() {
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return -1;
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
}

View File

@ -1,400 +0,0 @@
// jDownloader - Downloadmanager
// Copyright (C) 2009 JD-Team support@jdownloader.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.SortedMap;
import java.util.TreeMap;
import jd.PluginWrapper;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import org.appwork.utils.formatter.SizeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "uploadville.com" }, urls = { "http://[\\w\\.]*?uploadville\\.com/[a-z0-9]{12}" }, flags = { 0 })
public class UploadVilleCom extends PluginForHost {
public String brbefore = "";
private static final String PASSWORDTEXT0 = "<br><b>Password:</b> <input";
private static final String PASSWORDTEXT1 = "<br><b>Passwort:</b> <input";
private static final String COOKIE_HOST = "http://uploadville.com";
public boolean nopremium = false;
public UploadVilleCom(PluginWrapper wrapper) {
super(wrapper);
// this.enablePremium(COOKIE_HOST + "/premium.html");
}
public void checkErrors(DownloadLink theLink, boolean checkAll, String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (brbefore.contains("<br><b>Password:</b> <input") || brbefore.contains("<br><b>Passwort:</b> <input") || brbefore.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
theLink.setProperty("pass", null);
throw new PluginException(LinkStatus.ERROR_RETRY);
}
if (brbefore.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
}
// Some waittimes...
if (brbefore.contains("You have to wait")) {
int minutes = 0, seconds = 0, hours = 0;
String tmphrs = new Regex(brbefore, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
String tmpmin = new Regex(brbefore, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
String tmpsec = new Regex(brbefore, "You have to wait.*?\\s+(\\d+)\\s+seconds?").getMatch(0);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
int waittime = ((3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #1, waiting " + waittime + "milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
if (brbefore.contains("You have reached the download-limit")) {
String tmphrs = new Regex(brbefore, "\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(brbefore, "\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(brbefore, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(brbefore, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (brbefore.contains("You're using all download slots for IP")) throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l);
if (brbefore.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
// Errorhandling for only-premium links
if (brbefore.contains("You can download files up to") || brbefore.contains("Upgrade your account to download bigger files") || brbefore.contains("This file reached max downloads")) {
String filesizelimit = new Regex(brbefore, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.warning("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, "Free users can only download files up to " + filesizelimit);
} else {
logger.warning("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, "Only downloadable via premium");
}
}
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (brbefore.contains("No file")) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (brbefore.contains("File Not Found") || brbefore.contains("<h1>404 Not Found</h1>")) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
public void doFree(DownloadLink downloadLink) throws Exception, PluginException {
String passCode = null;
boolean resumable = true;
int maxchunks = 0;
// If the filesize regex above doesn't match you can copy this part into
// the available status (and delete it here)
Form freeform = br.getFormBySubmitvalue("Kostenloser+Download");
if (freeform == null) {
freeform = br.getFormBySubmitvalue("Free+Download");
if (freeform == null) {
freeform = br.getFormbyKey("download1");
}
}
if (freeform != null) {
freeform.remove("method_premium");
br.submitForm(freeform);
doSomething();
}
checkErrors(downloadLink, false, passCode);
String md5hash = new Regex(brbefore, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) {
md5hash = md5hash.trim();
logger.info("Found md5hash: " + md5hash);
downloadLink.setMD5Hash(md5hash);
}
br.setFollowRedirects(false);
Form DLForm = br.getFormbyProperty("name", "F1");
if (DLForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
// // Ticket Time
// String ttt = new Regex(brbefore,
// "countdown\">.*?(\\d+).*?</span>").getMatch(0);
// if (ttt == null) ttt = new Regex(brbefore,
// "id=\"countdown_str\".*?<span id=\".*?\">.*?(\\d+).*?</span").getMatch(0);
// if (ttt != null) {
// logger.info("Waittime detected, waiting " + ttt +
// " seconds from now on...");
// int tt = Integer.parseInt(ttt);
// sleep(tt * 1001, downloadLink);
// }
boolean password = false;
boolean recaptcha = false;
if (brbefore.contains(PASSWORDTEXT0) || brbefore.contains(PASSWORDTEXT1)) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
/* Captcha START */
if (brbefore.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
// Captcha method by ManiacMansion
String[][] letters = new Regex(Encoding.htmlDecode(br.toString()), "<span style='position:absolute;padding-left:(\\d+)px;padding-top:\\d+px;'>(\\d)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), letter[1]);
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
DLForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (brbefore.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode(captchaurl, downloadLink);
DLForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (brbefore.contains("api.recaptcha.net")) {
// Some hosters also got commentfields with captchas, therefore is
// the !br.contains...check Exampleplugin:
// FileGigaCom
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.parse();
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
if (password) {
passCode = handlePassword(passCode, rc.getForm(), downloadLink);
}
recaptcha = true;
rc.setCode(c);
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
}
/* Captcha END */
// If the hoster uses Re Captcha the form has already been sent before
// here so here it's checked. Most hosters don't use Re Captcha so
// usually recaptcha is false
if (!recaptcha) {
if (password) {
passCode = handlePassword(passCode, DLForm, downloadLink);
}
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLForm, resumable, maxchunks);
logger.info("Submitted DLForm");
}
if (dl.getConnection().getContentType().contains("html")) {
br.followConnection();
logger.info("followed connection...");
doSomething();
checkErrors(downloadLink, true, passCode);
String dllink = getDllink();
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
}
if (passCode != null) {
downloadLink.setProperty("pass", passCode);
}
dl.startDownload();
}
// Removed fake messages which can kill the plugin
public void doSomething() throws NumberFormatException, PluginException {
brbefore = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<!(--.*?--)>");
regexStuff.add("(display: none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
brbefore = brbefore.replace(fun, "");
}
}
// XfileSharingProBasic Version 1.8
// This is only for developers to easily implement hosters using the
// "xfileshare(pro)" script (more informations can be found on
// xfilesharing.net)!
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public String getDllink() {
String dllink = new Regex(brbefore, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(brbefore, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(brbefore, "Download: <a href=\"(.*?)\"").getMatch(0);
}
}
return dllink;
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return 1;
}
@Override
public void handleFree(DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink);
}
public String handlePassword(String passCode, Form pwform, DownloadLink thelink) throws IOException, PluginException {
if (thelink.getStringProperty("pass", null) == null) {
passCode = Plugin.getUserInput("Password?", thelink);
} else {
/* gespeicherten PassCode holen */
passCode = thelink.getStringProperty("pass", null);
}
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return passCode;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
@Override
public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
this.setBrowserExclusive();
br.setFollowRedirects(false);
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(link.getDownloadURL());
doSomething();
if (brbefore.contains("No such file") || brbefore.contains("No such user exist") || brbefore.contains("File not found") || brbefore.contains("File Not Found")) {
logger.warning("file is 99,99% offline, throwing \"file not found\" now...");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
String filename = br.getRegex("You have requested.*?http://.*?[a-z0-9]{12}/(.*?)</font>").getMatch(0);
if (filename == null) {
filename = new Regex(brbefore, "fname\" value=\"(.*?)\"").getMatch(0);
if (filename == null) {
filename = new Regex(brbefore, "<h2>Download File(.*?)</h2>").getMatch(0);
if (filename == null) {
filename = new Regex(brbefore, "Filename:</b></td><td[ ]{0,2}>(.*?)</td>").getMatch(0);
if (filename == null) {
filename = new Regex(brbefore, "Filename.*?nowrap.*?>(.*?)</td").getMatch(0);
if (filename == null) {
filename = new Regex(brbefore, "File Name.*?nowrap>(.*?)</td").getMatch(0);
}
}
}
}
}
String filesize = new Regex(brbefore, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (filesize == null) {
filesize = new Regex(brbefore, "<small>\\((.*?)\\)</small>").getMatch(0);
if (filesize == null) {
filesize = new Regex(brbefore, "</font>[ ]+\\((.*?)\\)(.*?)</font>").getMatch(0);
}
}
if (filename == null || filename.equals("")) {
if (brbefore.contains("You have reached the download-limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("The filename equals null, throwing \"plugin defect\" now...");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
filename = filename.replaceAll("(</b>|<b>|\\.html)", "");
link.setName(filename.trim());
if (filesize != null && !filesize.equals("")) {
logger.info("Filesize found, filesize = " + filesize);
link.setDownloadSize(SizeFormatter.getSize(filesize));
}
return AvailableStatus.TRUE;
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
}

View File

@ -0,0 +1,776 @@
//jDownloader - Downloadmanager
//Copyright (C) 2012 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import jd.PluginWrapper;
import jd.config.Property;
import jd.http.Browser;
import jd.http.Cookie;
import jd.http.Cookies;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.parser.html.Form;
import jd.parser.html.HTMLParser;
import jd.parser.html.InputField;
import jd.plugins.Account;
import jd.plugins.AccountInfo;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "venusfile.com" }, urls = { "https?://(www\\.)?venusfile\\.com/[a-z0-9]{12}" }, flags = { 2 })
public class VenusFileCom extends PluginForHost {
private String correctedBR = "";
private static final String PASSWORDTEXT = "<br><b>Passwor(d|t):</b> <input";
private final String COOKIE_HOST = "http://venusfile.com";
private static final String MAINTENANCE = ">This server is in maintenance mode";
private static final String MAINTENANCEUSERTEXT = JDL.L("hoster.xfilesharingprobasic.errors.undermaintenance", "This server is under Maintenance");
private static final String ALLWAIT_SHORT = JDL.L("hoster.xfilesharingprobasic.errors.waitingfordownloads", "Waiting till new downloads can be started");
private static final String PREMIUMONLY1 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly1", "Max downloadable filesize for free users:");
private static final String PREMIUMONLY2 = JDL.L("hoster.xfilesharingprobasic.errors.premiumonly2", "Only downloadable via premium or registered");
// note: can not be negative -x or 0 .:. [1-*]
private static AtomicInteger totalMaxSimultanFreeDownload = new AtomicInteger(1);
// don't touch
private static AtomicInteger maxFree = new AtomicInteger(1);
// DEV NOTES
/**
* Script notes: Streaming versions of this script sometimes redirect you to
* their directlinks when accessing this link + the link ID:
* http://somehoster.in/vidembed-
* */
// XfileSharingProBasic Version 2.5.7.6
// mods:
// non account: 1 * 1
// free account: 1 * 1
// premium account: untested, set standard limits
// protocol: no https
// captchatype: recaptcha
// other: no redirects, no captcha for free accounts
@Override
public void correctDownloadLink(DownloadLink link) {
link.setUrlDownload(link.getDownloadURL().replace("https://", "http://"));
}
@Override
public String getAGBLink() {
return COOKIE_HOST + "/tos.html";
}
public VenusFileCom(PluginWrapper wrapper) {
super(wrapper);
this.enablePremium(COOKIE_HOST + "/premium.html");
}
// do not add @Override here to keep 0.* compatibility
public boolean hasAutoCaptcha() {
return true;
}
// do not add @Override here to keep 0.* compatibility
public boolean hasCaptcha() {
return true;
}
public void prepBrowser(final Browser br) {
// define custom browser headers and language settings.
br.getHeaders().put("Accept-Language", "en-gb, en;q=0.9, de;q=0.8");
br.setCookie(COOKIE_HOST, "lang", "english");
}
@Override
public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {
br.setFollowRedirects(true);
prepBrowser(br);
getPage(link.getDownloadURL());
br.setFollowRedirects(false);
if (new Regex(correctedBR, "(No such file|>File Not Found<|>The file was removed by|Reason for deletion:\n)").matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, MAINTENANCE).matches()) {
link.getLinkStatus().setStatusText(MAINTENANCEUSERTEXT);
return AvailableStatus.TRUE;
}
if (br.getURL().contains("/?op=login&redirect=")) {
link.getLinkStatus().setStatusText(PREMIUMONLY2);
return AvailableStatus.UNCHECKABLE;
}
String[] fileInfo = new String[3];
// scan the first page
scanInfo(fileInfo);
// scan the second page. filesize[1] and md5hash[2] are not mission
// critical
if (fileInfo[0] == null) {
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
waitTime(System.currentTimeMillis(), link);
sendForm(download1);
scanInfo(fileInfo);
}
}
if (fileInfo[0] == null || fileInfo[0].equals("")) {
if (correctedBR.contains("You have reached the download(\\-| )limit")) {
logger.warning("Waittime detected, please reconnect to make the linkchecker work!");
return AvailableStatus.UNCHECKABLE;
}
logger.warning("filename equals null, throwing \"plugin defect\"");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (fileInfo[2] != null && !fileInfo[2].equals("")) link.setMD5Hash(fileInfo[2].trim());
fileInfo[0] = fileInfo[0].replaceAll("(</b>|<b>|\\.html)", "");
link.setFinalFileName(fileInfo[0].trim());
if (fileInfo[1] != null && !fileInfo[1].equals("")) link.setDownloadSize(SizeFormatter.getSize(fileInfo[1]));
return AvailableStatus.TRUE;
}
private String[] scanInfo(final String[] fileInfo) {
// standard traits from base page
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "You have requested.*?https?://(www\\.)?" + this.getHost() + "/[A-Za-z0-9]{12}/(.*?)</font>").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "fname\"( type=\"hidden\")? value=\"(.*?)\"").getMatch(1);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "<h2>Download File(.*?)</h2>").getMatch(0);
// traits from download1 page below.
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "Filename:? ?(<[^>]+> ?)+?([^<>\"\\']+)").getMatch(1);
// next two are details from sharing box
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+>(.+) \\- [\\d\\.]+ (KB|MB|GB)</a></textarea>[\r\n\t ]+</div>").getMatch(0);
if (fileInfo[0] == null) {
fileInfo[0] = new Regex(correctedBR, "copy\\(this\\);.+\\](.+) \\- [\\d\\.]+ (KB|MB|GB)\\[/URL\\]").getMatch(0);
}
}
}
}
}
}
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "\\(([0-9]+ bytes)\\)").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "</font>[ ]+\\(([^<>\"\\'/]+)\\)(.*?)</font>").getMatch(0);
if (fileInfo[1] == null) {
fileInfo[1] = new Regex(correctedBR, "([\\d\\.]+ ?(KB|MB|GB))").getMatch(0);
}
}
}
if (fileInfo[2] == null) fileInfo[2] = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
return fileInfo;
}
@Override
public void handleFree(final DownloadLink downloadLink) throws Exception, PluginException {
requestFileInformation(downloadLink);
doFree(downloadLink, false, 1, "freelink");
}
public void doFree(final DownloadLink downloadLink, final boolean resumable, final int maxchunks, final String directlinkproperty) throws Exception, PluginException {
String passCode = null;
// First, bring up saved final links
String dllink = checkDirectLink(downloadLink, directlinkproperty);
// Second, check for streaming links on the first page
if (dllink == null) dllink = getDllink();
// Third, continue like normal.
if (dllink == null) {
checkErrors(downloadLink, false, passCode);
Form download1 = getFormByKey("op", "download1");
if (download1 != null) {
download1.remove("method_premium");
sendForm(download1);
checkErrors(downloadLink, false, passCode);
}
dllink = getDllink();
}
if (dllink == null) {
Form dlForm = br.getFormbyProperty("name", "F1");
if (dlForm == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
// how many forms deep do you want to try.
int repeat = 3;
for (int i = 1; i <= repeat; i++) {
dlForm.remove(null);
final long timeBefore = System.currentTimeMillis();
boolean password = false;
boolean skipWaittime = false;
if (new Regex(correctedBR, PASSWORDTEXT).matches()) {
password = true;
logger.info("The downloadlink seems to be password protected.");
}
// md5 can be on the subquent pages
if (downloadLink.getMD5Hash() == null) {
String md5hash = new Regex(correctedBR, "<b>MD5.*?</b>.*?nowrap>(.*?)<").getMatch(0);
if (md5hash != null) downloadLink.setMD5Hash(md5hash.trim());
}
/* Captcha START */
if (correctedBR.contains(";background:#ccc;text-align")) {
logger.info("Detected captcha method \"plaintext captchas\" for this host");
/** Captcha method by ManiacMansion */
String[][] letters = new Regex(br, "<span style=\\'position:absolute;padding\\-left:(\\d+)px;padding\\-top:\\d+px;\\'>(&#\\d+;)</span>").getMatches();
if (letters == null || letters.length == 0) {
logger.warning("plaintext captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
SortedMap<Integer, String> capMap = new TreeMap<Integer, String>();
for (String[] letter : letters) {
capMap.put(Integer.parseInt(letter[0]), Encoding.htmlDecode(letter[1]));
}
StringBuilder code = new StringBuilder();
for (String value : capMap.values()) {
code.append(value);
}
dlForm.put("code", code.toString());
logger.info("Put captchacode " + code.toString() + " obtained by captcha metod \"plaintext captchas\" in the form.");
} else if (correctedBR.contains("/captchas/")) {
logger.info("Detected captcha method \"Standard captcha\" for this host");
String[] sitelinks = HTMLParser.getHttpLinks(br.toString(), null);
String captchaurl = null;
if (sitelinks == null || sitelinks.length == 0) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
for (String link : sitelinks) {
if (link.contains("/captchas/")) {
captchaurl = link;
break;
}
}
if (captchaurl == null) {
logger.warning("Standard captcha captchahandling broken!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
String code = getCaptchaCode("xfilesharingprobasic", captchaurl, downloadLink);
dlForm.put("code", code);
logger.info("Put captchacode " + code + " obtained by captcha metod \"Standard captcha\" in the form.");
} else if (new Regex(correctedBR, "(api\\.recaptcha\\.net|google\\.com/recaptcha/api/)").matches()) {
logger.info("Detected captcha method \"Re Captcha\" for this host");
PluginForHost recplug = JDUtilities.getPluginForHost("DirectHTTP");
jd.plugins.hoster.DirectHTTP.Recaptcha rc = ((DirectHTTP) recplug).getReCaptcha(br);
rc.setForm(dlForm);
String id = new Regex(correctedBR, "\\?k=([A-Za-z0-9%_\\+\\- ]+)\"").getMatch(0);
rc.setId(id);
rc.load();
File cf = rc.downloadCaptcha(getLocalCaptchaFile());
String c = getCaptchaCode(cf, downloadLink);
Form rcform = rc.getForm();
rcform.put("recaptcha_challenge_field", rc.getChallenge());
rcform.put("recaptcha_response_field", Encoding.urlEncode(c));
logger.info("Put captchacode " + c + " obtained by captcha metod \"Re Captcha\" in the form and submitted it.");
dlForm = rc.getForm();
/** wait time is often skippable for reCaptcha handling */
skipWaittime = true;
}
/* Captcha END */
if (password) passCode = handlePassword(passCode, dlForm, downloadLink);
if (!skipWaittime) waitTime(timeBefore, downloadLink);
sendForm(dlForm);
logger.info("Submitted DLForm");
checkErrors(downloadLink, true, passCode);
dllink = getDllink();
if (dllink == null && (!br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"") || i == repeat)) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
} else if (dllink == null && br.containsHTML("<Form name=\"F1\" method=\"POST\" action=\"\"")) {
dlForm = br.getFormbyProperty("name", "F1");
continue;
} else {
break;
}
}
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, resumable, maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
downloadLink.setProperty(directlinkproperty, dllink);
if (passCode != null) downloadLink.setProperty("pass", passCode);
fixFilename(downloadLink);
try {
// add a download slot
controlFree(+1);
// start the dl
dl.startDownload();
} finally {
// remove download slot
controlFree(-1);
}
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return maxFree.get();
}
/**
* Prevents more than one free download from starting at a given time. One
* step prior to dl.startDownload(), it adds a slot to maxFree which allows
* the next singleton download to start, or at least try.
*
* This is needed because xfileshare(website) only throws errors after a
* final dllink starts transferring or at a given step within pre download
* sequence. But this template(XfileSharingProBasic) allows multiple
* slots(when available) to commence the download sequence,
* this.setstartintival does not resolve this issue. Which results in x(20)
* captcha events all at once and only allows one download to start. This
* prevents wasting peoples time and effort on captcha solving and|or
* wasting captcha trading credits. Users will experience minimal harm to
* downloading as slots are freed up soon as current download begins.
*
* @param controlFree
* (+1|-1)
*/
public synchronized void controlFree(final int num) {
logger.info("maxFree was = " + maxFree.get());
maxFree.set(Math.min(Math.max(1, maxFree.addAndGet(num)), totalMaxSimultanFreeDownload.get()));
logger.info("maxFree now = " + maxFree.get());
}
/** Remove HTML code which could break the plugin */
public void correctBR() throws NumberFormatException, PluginException {
correctedBR = br.toString();
ArrayList<String> someStuff = new ArrayList<String>();
ArrayList<String> regexStuff = new ArrayList<String>();
regexStuff.add("<\\!(\\-\\-.*?\\-\\-)>");
regexStuff.add("(display: ?none;\">.*?</div>)");
regexStuff.add("(visibility:hidden>.*?<)");
for (String aRegex : regexStuff) {
String lolz[] = br.getRegex(aRegex).getColumn(0);
if (lolz != null) {
for (String dingdang : lolz) {
someStuff.add(dingdang);
}
}
}
for (String fun : someStuff) {
correctedBR = correctedBR.replace(fun, "");
}
}
public String getDllink() {
String dllink = br.getRedirectLocation();
if (dllink == null) {
dllink = new Regex(correctedBR, "dotted #bbb;padding.*?<a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "This (direct link|download link) will be available for your IP.*?href=\"(http.*?)\"").getMatch(1);
if (dllink == null) {
dllink = new Regex(correctedBR, "Download: <a href=\"(.*?)\"").getMatch(0);
if (dllink == null) {
dllink = new Regex(correctedBR, "<a href=\"(https?://[^\"]+)\"[^>]+>(Click to Download|Download File)").getMatch(0);
// generic fail over for COOKIE_HOST on final link
// format.
if (dllink == null) {
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/cgi\\-bin/dl\\.cgi/[a-z0-9]+/[^\"\\']+)").getMatch(0);
// dllink = new Regex(correctedBR,
// "(https?://[^/]+/files/\\d+/[a-z0-9]+/[^\"\\']+)").getMatch(0);
if (dllink == null) {
String cryptedScripts[] = new Regex(correctedBR, "p\\}\\((.*?)\\.split\\('\\|'\\)").getColumn(0);
if (cryptedScripts != null && cryptedScripts.length != 0) {
for (String crypted : cryptedScripts) {
dllink = decodeDownloadLink(crypted);
if (dllink != null) break;
}
}
}
}
}
}
}
}
return dllink;
}
private String decodeDownloadLink(final String s) {
String decoded = null;
try {
Regex params = new Regex(s, "\\'(.*?[^\\\\])\\',(\\d+),(\\d+),\\'(.*?)\\'");
String p = params.getMatch(0).replaceAll("\\\\", "");
int a = Integer.parseInt(params.getMatch(1));
int c = Integer.parseInt(params.getMatch(2));
String[] k = params.getMatch(3).split("\\|");
while (c != 0) {
c--;
if (k[c].length() != 0) p = p.replaceAll("\\b" + Integer.toString(c, a) + "\\b", k[c]);
}
decoded = p;
} catch (Exception e) {
}
String finallink = null;
if (decoded != null) {
finallink = new Regex(decoded, "name=\"src\"value=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "type=\"video/divx\"src=\"(.*?)\"").getMatch(0);
if (finallink == null) {
finallink = new Regex(decoded, "\\.addVariable\\(\\'file\\',\\'(http://.*?)\\'\\)").getMatch(0);
}
}
}
return finallink;
}
private String checkDirectLink(final DownloadLink downloadLink, final String property) {
String dllink = downloadLink.getStringProperty(property);
if (dllink != null) {
try {
Browser br2 = br.cloneBrowser();
URLConnectionAdapter con = br2.openGetConnection(dllink);
if (con.getContentType().contains("html") || con.getLongContentLength() == -1) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
con.disconnect();
} catch (Exception e) {
downloadLink.setProperty(property, Property.NULL);
dllink = null;
}
}
return dllink;
}
private void getPage(final String page) throws Exception {
br.getPage(page);
correctBR();
}
private void postPage(final String page, final String postdata) throws Exception {
br.postPage(page, postdata);
correctBR();
}
private void sendForm(final Form form) throws Exception {
br.submitForm(form);
correctBR();
}
private void waitTime(long timeBefore, final DownloadLink downloadLink) throws PluginException {
int passedTime = (int) ((System.currentTimeMillis() - timeBefore) / 1000) - 1;
/** Ticket Time */
final String ttt = new Regex(correctedBR, "id=\"countdown_str\">[^<>\"]+<span id=\"[^<>\"]+\"( class=\"[^<>\"]+\")?>([\n ]+)?(\\d+)([\n ]+)?</span>").getMatch(2);
if (ttt != null) {
int tt = Integer.parseInt(ttt);
tt -= passedTime;
logger.info("Waittime detected, waiting " + ttt + " - " + passedTime + " seconds from now on...");
if (tt > 0) sleep(tt * 1000l, downloadLink);
}
}
// TODO: remove this when v2 becomes stable. use br.getFormbyKey(String key,
// String value)
/**
* Returns the first form that has a 'key' that equals 'value'.
*
* @param key
* @param value
* @return
*/
private Form getFormByKey(final String key, final String value) {
Form[] workaround = br.getForms();
if (workaround != null) {
for (Form f : workaround) {
for (InputField field : f.getInputFields()) {
if (key != null && key.equals(field.getKey())) {
if (value == null && field.getValue() == null) return f;
if (value != null && value.equals(field.getValue())) return f;
}
}
}
}
return null;
}
private void fixFilename(final DownloadLink downloadLink) {
final String serverFilename = Encoding.htmlDecode(getFileNameFromHeader(dl.getConnection()));
final String newExtension = serverFilename.substring(serverFilename.lastIndexOf("."));
if (newExtension != null && !downloadLink.getFinalFileName().endsWith(newExtension)) {
final String oldExtension = downloadLink.getFinalFileName().substring(downloadLink.getFinalFileName().lastIndexOf("."));
if (oldExtension != null)
downloadLink.setFinalFileName(downloadLink.getFinalFileName().replace(oldExtension, newExtension));
else
downloadLink.setFinalFileName(downloadLink.getFinalFileName() + newExtension);
}
}
private String handlePassword(String passCode, final Form pwform, final DownloadLink thelink) throws IOException, PluginException {
passCode = thelink.getStringProperty("pass", null);
if (passCode == null) passCode = Plugin.getUserInput("Password?", thelink);
pwform.put("password", passCode);
logger.info("Put password \"" + passCode + "\" entered by user in the DLForm.");
return Encoding.urlEncode(passCode);
}
public void checkErrors(final DownloadLink theLink, final boolean checkAll, final String passCode) throws NumberFormatException, PluginException {
if (checkAll) {
if (new Regex(correctedBR, PASSWORDTEXT).matches() || correctedBR.contains("Wrong password")) {
logger.warning("Wrong password, the entered password \"" + passCode + "\" is wrong, retrying...");
throw new PluginException(LinkStatus.ERROR_RETRY, "Wrong password entered");
}
if (correctedBR.contains("Wrong captcha")) {
logger.warning("Wrong captcha or wrong password!");
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
if (correctedBR.contains("\">Skipped countdown<")) throw new PluginException(LinkStatus.ERROR_FATAL, "Fatal countdown error (countdown skipped)");
}
/** Wait time reconnect handling */
if (new Regex(correctedBR, "(You have reached the download(\\-| )limit|You have to wait)").matches()) {
// adjust this regex to catch the wait time string for COOKIE_HOST
String WAIT = new Regex(correctedBR, "((You have reached the download(\\-| )limit|You have to wait)[^<>]+)").getMatch(0);
String tmphrs = new Regex(WAIT, "\\s+(\\d+)\\s+hours?").getMatch(0);
if (tmphrs == null) tmphrs = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+hours?").getMatch(0);
String tmpmin = new Regex(WAIT, "\\s+(\\d+)\\s+minutes?").getMatch(0);
if (tmpmin == null) tmpmin = new Regex(correctedBR, "You have to wait.*?\\s+(\\d+)\\s+minutes?").getMatch(0);
String tmpsec = new Regex(WAIT, "\\s+(\\d+)\\s+seconds?").getMatch(0);
String tmpdays = new Regex(WAIT, "\\s+(\\d+)\\s+days?").getMatch(0);
if (tmphrs == null && tmpmin == null && tmpsec == null && tmpdays == null) {
logger.info("Waittime regexes seem to be broken");
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 60 * 60 * 1000l);
} else {
int minutes = 0, seconds = 0, hours = 0, days = 0;
if (tmphrs != null) hours = Integer.parseInt(tmphrs);
if (tmpmin != null) minutes = Integer.parseInt(tmpmin);
if (tmpsec != null) seconds = Integer.parseInt(tmpsec);
if (tmpdays != null) days = Integer.parseInt(tmpdays);
int waittime = ((days * 24 * 3600) + (3600 * hours) + (60 * minutes) + seconds + 1) * 1000;
logger.info("Detected waittime #2, waiting " + waittime + "milliseconds");
/** Not enough wait time to reconnect->Wait and try again */
if (waittime < 180000) { throw new PluginException(LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE, JDL.L("plugins.hoster.xfilesharingprobasic.allwait", ALLWAIT_SHORT), waittime); }
throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, waittime);
}
}
if (correctedBR.contains("You're using all download slots for IP")) { throw new PluginException(LinkStatus.ERROR_IP_BLOCKED, null, 10 * 60 * 1001l); }
if (correctedBR.contains("Error happened when generating Download Link")) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error!", 10 * 60 * 1000l);
/** Error handling for only-premium links */
if (new Regex(correctedBR, "( can download files up to |Upgrade your account to download bigger files|>Upgrade your account to download larger files|>The file you requested reached max downloads limit for Free Users|Please Buy Premium To download this file<|This file reached max downloads limit)").matches()) {
String filesizelimit = new Regex(correctedBR, "You can download files up to(.*?)only").getMatch(0);
if (filesizelimit != null) {
filesizelimit = filesizelimit.trim();
logger.info("As free user you can download files up to " + filesizelimit + " only");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY1 + " " + filesizelimit);
} else {
logger.info("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
}
}
if (br.getURL().contains("/?op=login&redirect=")) {
logger.info("Only downloadable via premium");
throw new PluginException(LinkStatus.ERROR_FATAL, PREMIUMONLY2);
}
if (new Regex(correctedBR, MAINTENANCE).matches()) throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, MAINTENANCEUSERTEXT, 2 * 60 * 60 * 1000l);
}
public void checkServerErrors() throws NumberFormatException, PluginException {
if (new Regex(correctedBR, Pattern.compile("No file", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FATAL, "Server error");
if (new Regex(correctedBR, "(File Not Found|<h1>404 Not Found</h1>)").matches()) {
logger.warning("Server says link offline, please recheck that!");
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
}
private static AtomicInteger maxPrem = new AtomicInteger(1);
private static Object LOCK = new Object();
@Override
public AccountInfo fetchAccountInfo(Account account) throws Exception {
AccountInfo ai = new AccountInfo();
/* reset maxPrem workaround on every fetchaccount info */
maxPrem.set(1);
try {
login(account, true);
} catch (PluginException e) {
account.setValid(false);
return ai;
}
final String space[][] = new Regex(correctedBR, "<td>Used space:</td>.*?<td.*?b>([0-9\\.]+) of [0-9\\.]+ (KB|MB|GB|TB)</b>").getMatches();
if ((space != null && space.length != 0) && (space[0][0] != null && space[0][1] != null)) ai.setUsedSpace(space[0][0] + " " + space[0][1]);
account.setValid(true);
final String availabletraffic = new Regex(correctedBR, "Traffic available.*?:</TD><TD><b>([^<>\"\\']+)</b>").getMatch(0);
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equalsIgnoreCase(" Mb")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setUnlimitedTraffic();
}
if (account.getBooleanProperty("nopremium")) {
ai.setStatus("Registered (free) User");
try {
maxPrem.set(1);
// free accounts can still have captcha.
totalMaxSimultanFreeDownload.set(maxPrem.get());
account.setMaxSimultanDownloads(maxPrem.get());
// This one doesn't have captchas
account.setConcurrentUsePossible(true);
} catch (final Throwable e) {
}
} else {
final String expire = new Regex(correctedBR, "(\\d{1,2} (January|February|March|April|May|June|July|August|September|October|November|December) \\d{4})").getMatch(0);
if (expire == null) {
ai.setExpired(true);
account.setValid(false);
return ai;
} else {
ai.setValidUntil(TimeFormatter.getMilliSeconds(expire, "dd MMMM yyyy", Locale.ENGLISH));
try {
maxPrem.set(1);
account.setMaxSimultanDownloads(maxPrem.get());
account.setConcurrentUsePossible(true);
} catch (final Throwable e) {
}
}
ai.setStatus("Premium User");
}
return ai;
}
@SuppressWarnings("unchecked")
private void login(final Account account, final boolean force) throws Exception {
synchronized (LOCK) {
try {
/** Load cookies */
br.setCookiesExclusive(true);
prepBrowser(br);
final Object ret = account.getProperty("cookies", null);
boolean acmatch = Encoding.urlEncode(account.getUser()).equals(account.getStringProperty("name", Encoding.urlEncode(account.getUser())));
if (acmatch) acmatch = Encoding.urlEncode(account.getPass()).equals(account.getStringProperty("pass", Encoding.urlEncode(account.getPass())));
if (acmatch && ret != null && ret instanceof HashMap<?, ?> && !force) {
final HashMap<String, String> cookies = (HashMap<String, String>) ret;
if (account.isValid()) {
for (final Map.Entry<String, String> cookieEntry : cookies.entrySet()) {
final String key = cookieEntry.getKey();
final String value = cookieEntry.getValue();
this.br.setCookie(COOKIE_HOST, key, value);
}
return;
}
}
br.setFollowRedirects(true);
getPage(COOKIE_HOST + "/login.html");
final Form loginform = br.getFormbyProperty("name", "FL");
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
loginform.put("login", Encoding.urlEncode(account.getUser()));
loginform.put("password", Encoding.urlEncode(account.getPass()));
sendForm(loginform);
if (br.getCookie(COOKIE_HOST, "login") == null || br.getCookie(COOKIE_HOST, "xfss") == null) throw new PluginException(LinkStatus.ERROR_PREMIUM, PluginException.VALUE_ID_PREMIUM_DISABLE);
getPage(COOKIE_HOST + "/?op=my_account");
if (!new Regex(correctedBR, "(Premium(\\-| )Account expire|>Renew premium<)").matches()) {
account.setProperty("nopremium", true);
} else {
account.setProperty("nopremium", false);
}
/** Save cookies */
final HashMap<String, String> cookies = new HashMap<String, String>();
final Cookies add = this.br.getCookies(COOKIE_HOST);
for (final Cookie c : add.getCookies()) {
cookies.put(c.getKey(), c.getValue());
}
account.setProperty("name", Encoding.urlEncode(account.getUser()));
account.setProperty("pass", Encoding.urlEncode(account.getPass()));
account.setProperty("cookies", cookies);
} catch (final PluginException e) {
account.setProperty("cookies", Property.NULL);
throw e;
}
}
}
@Override
public void handlePremium(final DownloadLink downloadLink, final Account account) throws Exception {
String passCode = null;
requestFileInformation(downloadLink);
login(account, false);
br.setFollowRedirects(false);
String dllink = null;
if (account.getBooleanProperty("nopremium")) {
requestFileInformation(downloadLink);
doFree(downloadLink, false, 1, "freelink2");
} else {
dllink = checkDirectLink(downloadLink, "premlink");
if (dllink == null) {
getPage(downloadLink.getDownloadURL());
dllink = getDllink();
if (dllink == null) {
checkErrors(downloadLink, true, passCode);
Form dlform = br.getFormbyProperty("name", "F1");
if (dlform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
if (new Regex(correctedBR, PASSWORDTEXT).matches()) passCode = handlePassword(passCode, dlform, downloadLink);
sendForm(dlform);
dllink = getDllink();
checkErrors(downloadLink, true, passCode);
}
}
if (dllink == null) {
logger.warning("Final downloadlink (String is \"dllink\") regex didn't match!");
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
logger.info("Final downloadlink = " + dllink + " starting the download...");
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, dllink, true, -10);
if (dl.getConnection().getContentType().contains("html")) {
logger.warning("The final dllink seems not to be a file!");
br.followConnection();
correctBR();
checkServerErrors();
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
if (passCode != null) downloadLink.setProperty("pass", passCode);
fixFilename(downloadLink);
downloadLink.setProperty("premlink", dllink);
dl.startDownload();
}
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
/* workaround for free/premium issue on stable 09581 */
return maxPrem.get();
}
@Override
public void reset() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
}

View File

@ -52,11 +52,11 @@ public class VideoGoogle extends PluginForHost {
public AvailableStatus requestFileInformation(DownloadLink parameter) throws Exception {
this.setBrowserExclusive();
br.getPage(parameter.getDownloadURL());
// Check this way because language of site is different for everyone
if (!br.containsHTML("googleplayer\\.swf")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
final String videoID = new Regex(parameter.getDownloadURL(), "((\\-)?\\d+)$").getMatch(0);
String name = br.getRegex("<title>(.*?)</title>").getMatch(0);
if (br.containsHTML("but this video may not be availabl")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (name == null || "301 Moved".equals(name)) name = videoID;
if ("Google Videos Error".equals(name)) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
parameter.setFinalFileName(Encoding.htmlDecode(name) + ".flv");
DLLINK = br.getRegex("videoUrl\\\\x3d(http://.*?\\.googlevideo\\.com/videoplayback.*?)\\\\x26thumbnailUrl").getMatch(0);
if (DLLINK == null) {

View File

@ -75,7 +75,7 @@ public class XFileSharingProBasic extends PluginForHost {
* their directlinks when accessing this link + the link ID:
* http://somehoster.in/vidembed-
* */
// XfileSharingProBasic Version 2.5.7.5
// XfileSharingProBasic Version 2.5.7.6
// mods:
// non account: chunk * maxdl
// free account: chunk * maxdl
@ -635,7 +635,7 @@ public class XFileSharingProBasic extends PluginForHost {
if (account.getBooleanProperty("nopremium")) {
ai.setStatus("Registered (free) User");
try {
maxPrem.set(1);
maxPrem.set(-1);
// free accounts can still have captcha.
totalMaxSimultanFreeDownload.set(maxPrem.get());
account.setMaxSimultanDownloads(maxPrem.get());
@ -683,6 +683,7 @@ public class XFileSharingProBasic extends PluginForHost {
return;
}
}
br.setFollowRedirects(true);
getPage(COOKIE_HOST + "/login.html");
final Form loginform = br.getFormbyProperty("name", "FL");
if (loginform == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);

View File

@ -71,16 +71,15 @@ public class XXXAPornCom extends PluginForHost {
br.setFollowRedirects(true);
br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("No htmlCode read")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("<meta name=\"title\" content=\"(.*?)\" />").getMatch(0);
String filename = br.getRegex("<title>Viewing Media \\- (.*?):: Free Amateur Sex, Amateur Porn").getMatch(0);
if (filename == null) {
filename = br.getRegex("<div class=\"video\\-info\">[\t\n\r ]+<h1>(.*?)</h1>").getMatch(0);
if (filename == null) {
filename = br.getRegex("Viewing Media \\- (.*?)</title>").getMatch(0);
}
}
DLLINK = br.getRegex("addParam\\(\\'flashvars\\',\\'file=(http://.*?)\\'\\)").getMatch(0);
if (DLLINK == null) DLLINK = br.getRegex("(http://vids\\d+\\.xxxaporn\\.com/\\d+\\.flv)\\'").getMatch(0);
DLLINK = br.getRegex("(http://media\\.xxxaporn\\.com/media/player/config_embed\\.php\\?vkey=\\d+)").getMatch(0);
if (filename == null || DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
br.getPage(DLLINK);
DLLINK = br.getRegex("<src>(http://[^<>\"]*?)</src>").getMatch(0);
if (DLLINK == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
DLLINK = Encoding.htmlDecode(DLLINK);
filename = filename.trim();
downloadLink.setFinalFileName(Encoding.htmlDecode(filename) + ".flv");

View File

@ -69,7 +69,7 @@ public class YouPornDeutschCom extends PluginForHost {
br.setFollowRedirects(true);
br.setCustomCharset("utf-8");
br.getPage(downloadLink.getDownloadURL());
if (br.containsHTML("(\">This video cannot be found|<title>Youporn auf Deutsch</title>)")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (br.containsHTML("(\">This video cannot be found|<title>Youporn auf Deutsch</title>)") || br.getURL().contains("youporn-deutsch.com/error/video_missing")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("<div class=\"left span\\-630\">[\t\n\r ]+<h1>(.*?)</h1>").getMatch(0);
if (filename == null) filename = br.getRegex("<title>(.*?) \\- Pornofilm \\- Youporn auf Deutsch</title>").getMatch(0);
br.getPage("http://www.youporn-deutsch.com/media/player/config.php?vkey=" + new Regex(downloadLink.getDownloadURL(), "youporn\\-deutsch\\.com/video/(\\d+)").getMatch(0));

View File

@ -60,7 +60,10 @@ public class YourFileLinkCom extends PluginForHost {
this.setBrowserExclusive();
br.setFollowRedirects(false);
br.getPage(link.getDownloadURL());
// Invalid link
if (br.containsHTML(">404 Not Found<")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
br.getPage(link.getDownloadURL() + "&dv=1");
// Link offline
if (br.containsHTML("(>If you\\'re sure you have the URL correct then the file may have been deleted|>Please re\\-check the URL \\& try again)")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("<div class=\"filenametxt\">(.*?)</div>").getMatch(0);
if (filename == null) throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);

View File

@ -66,8 +66,17 @@ public class YuvutuCom extends PluginForHost {
br.setCookie("http://www.yuvutu.com/", "lang", "english");
br.setCookie("http://www.yuvutu.com/", "warningcookie", "viewed");
br.setFollowRedirects(false);
br.getPage(downloadLink.getDownloadURL());
final URLConnectionAdapter conf = br.openGetConnection(downloadLink.getDownloadURL());
if (conf.getResponseCode() == 410) {
conf.disconnect();
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
br.followConnection();
conf.disconnect();
// Link offline
if (br.containsHTML(">The video you requested does not exist<")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
// Invalid link
if (!br.containsHTML("player\\.swf")) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
String filename = br.getRegex("class=\"userName\">.*?img src.*?href.*?</a>:(.*?)</td").getMatch(0);
if (filename == null) filename = br.getRegex("<span class=\"authorName\">.*?<a href=\".*?\">.*?</a>.*?</span>(.*?)</td>.*?<td class=\"videoTitle\"").getMatch(0);
dllink = br.getRegex("value=\"file=(http[^<>\\&\"]*?)\\&").getMatch(0);

View File

@ -91,7 +91,7 @@ public class ZalaaCom extends PluginForHost {
br.setCookie(COOKIE_HOST, "lang", "english");
br.getPage(link.getDownloadURL());
doSomething();
if (new Regex(correctedBR, Pattern.compile("(No such file|>File Not Found<|>The file was removed by|Reason (of|for) deletion:\n|This file has been removed due to)", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (new Regex(correctedBR, Pattern.compile("(File Not Found|This file has been removed due to)", Pattern.CASE_INSENSITIVE)).matches()) throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
if (correctedBR.contains(MAINTENANCE)) {
link.getLinkStatus().setStatusText(JDL.L("plugins.hoster.xfilesharingprobasic.undermaintenance", MAINTENANCEUSERTEXT));
return AvailableStatus.TRUE;