summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
-rw-r--r--module/plugins/Account.py57
-rw-r--r--module/plugins/AccountManager.py27
-rw-r--r--module/plugins/Container.py34
-rw-r--r--module/plugins/Crypter.py4
-rw-r--r--module/plugins/Hook.py34
-rw-r--r--module/plugins/Hoster.py23
-rw-r--r--module/plugins/OCR.py44
-rw-r--r--module/plugins/Plugin.py44
-rw-r--r--module/plugins/PluginManager.py83
-rw-r--r--module/plugins/accounts/AlldebridCom.py18
-rw-r--r--module/plugins/accounts/BayfilesCom.py31
-rw-r--r--module/plugins/accounts/BitshareCom.py25
-rw-r--r--module/plugins/accounts/CramitIn.py3
-rw-r--r--module/plugins/accounts/CyberlockerCh.py4
-rw-r--r--module/plugins/accounts/CzshareCom.py33
-rw-r--r--module/plugins/accounts/DdlstorageCom.py52
-rw-r--r--module/plugins/accounts/DebridItaliaCom.py20
-rw-r--r--module/plugins/accounts/DepositfilesCom.py33
-rw-r--r--module/plugins/accounts/EasybytezCom.py35
-rw-r--r--module/plugins/accounts/EgoFilesCom.py6
-rw-r--r--module/plugins/accounts/EuroshareEu.py29
-rw-r--r--module/plugins/accounts/FastixRu.py10
-rw-r--r--module/plugins/accounts/FastshareCz.py27
-rw-r--r--module/plugins/accounts/File4safeCom.py3
-rw-r--r--module/plugins/accounts/FilecloudIo.py27
-rw-r--r--module/plugins/accounts/FilefactoryCom.py20
-rw-r--r--module/plugins/accounts/FilejungleCom.py29
-rw-r--r--module/plugins/accounts/FilerNet.py36
-rw-r--r--module/plugins/accounts/FilerioCom.py3
-rw-r--r--module/plugins/accounts/FilesMailRu.py21
-rw-r--r--module/plugins/accounts/FileserveCom.py35
-rw-r--r--module/plugins/accounts/FourSharedCom.py21
-rw-r--r--module/plugins/accounts/FreakshareCom.py20
-rw-r--r--module/plugins/accounts/FreeWayMe.py37
-rw-r--r--module/plugins/accounts/FshareVn.py39
-rw-r--r--module/plugins/accounts/Ftp.py4
-rw-r--r--module/plugins/accounts/HellshareCz.py29
-rw-r--r--module/plugins/accounts/HotfileCom.py33
-rw-r--r--module/plugins/accounts/Http.py4
-rw-r--r--module/plugins/accounts/LetitbitNet.py20
-rw-r--r--module/plugins/accounts/LinksnappyCom.py4
-rw-r--r--module/plugins/accounts/MegaDebridEu.py28
-rw-r--r--module/plugins/accounts/MegasharesCom.py4
-rw-r--r--module/plugins/accounts/MovReelCom.py7
-rw-r--r--module/plugins/accounts/MultiDebridCom.py26
-rw-r--r--module/plugins/accounts/MultishareCz.py25
-rwxr-xr-xmodule/plugins/accounts/NetloadIn.py21
-rw-r--r--module/plugins/accounts/OboomCom.py21
-rw-r--r--module/plugins/accounts/OneFichierCom.py10
-rw-r--r--module/plugins/accounts/OverLoadMe.py14
-rw-r--r--module/plugins/accounts/Premium4Me.py6
-rw-r--r--module/plugins/accounts/PremiumizeMe.py4
-rw-r--r--module/plugins/accounts/QuickshareCz.py27
-rw-r--r--module/plugins/accounts/RPNetBiz.py4
-rw-r--r--module/plugins/accounts/RapidgatorNet.py21
-rw-r--r--module/plugins/accounts/RapidshareCom.py29
-rw-r--r--module/plugins/accounts/RarefileNet.py3
-rw-r--r--module/plugins/accounts/RealdebridCom.py6
-rw-r--r--module/plugins/accounts/RehostTo.py8
-rw-r--r--module/plugins/accounts/ReloadCc.py75
-rw-r--r--module/plugins/accounts/RyushareCom.py6
-rw-r--r--module/plugins/accounts/ShareRapidCom.py33
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py35
-rw-r--r--module/plugins/accounts/SimplyPremiumCom.py33
-rw-r--r--module/plugins/accounts/SimplydebridCom.py6
-rw-r--r--module/plugins/accounts/StahnuTo.py27
-rw-r--r--module/plugins/accounts/TurbobitNet.py29
-rw-r--r--module/plugins/accounts/UlozTo.py8
-rw-r--r--module/plugins/accounts/UnrestrictLi.py24
-rw-r--r--module/plugins/accounts/UploadedTo.py23
-rw-r--r--module/plugins/accounts/UploadheroCom.py6
-rw-r--r--module/plugins/accounts/UploadingCom.py23
-rw-r--r--module/plugins/accounts/UptoboxCom.py3
-rw-r--r--module/plugins/accounts/Vipleech4uCom.py41
-rw-r--r--module/plugins/accounts/WarserverCz.py68
-rw-r--r--module/plugins/accounts/YibaishiwuCom.py27
-rw-r--r--module/plugins/accounts/ZeveraCom.py6
-rw-r--r--module/plugins/container/CCF.py19
-rw-r--r--module/plugins/container/LinkList.py14
-rw-r--r--module/plugins/container/RSDF.py12
-rw-r--r--module/plugins/crypter/BitshareComFolder.py18
-rw-r--r--module/plugins/crypter/C1neonCom.py4
-rw-r--r--module/plugins/crypter/ChipDe.py13
-rw-r--r--module/plugins/crypter/CrockoComFolder.py4
-rw-r--r--module/plugins/crypter/CryptItCom.py4
-rw-r--r--module/plugins/crypter/CzshareComFolder.py18
-rw-r--r--module/plugins/crypter/DDLMusicOrg.py8
-rw-r--r--module/plugins/crypter/DailymotionBatch.py39
-rw-r--r--module/plugins/crypter/DataHuFolder.py19
-rw-r--r--module/plugins/crypter/DdlstorageComFolder.py27
-rw-r--r--module/plugins/crypter/DepositfilesComFolder.py4
-rw-r--r--module/plugins/crypter/Dereferer.py25
-rw-r--r--module/plugins/crypter/DlProtectCom.py28
-rw-r--r--module/plugins/crypter/DontKnowMe.py14
-rw-r--r--module/plugins/crypter/DownloadVimeoCom.py30
-rw-r--r--module/plugins/crypter/DuckCryptInfo.py44
-rw-r--r--module/plugins/crypter/DuploadOrgFolder.py18
-rw-r--r--module/plugins/crypter/EasybytezComFolder.py20
-rw-r--r--module/plugins/crypter/EmbeduploadCom.py30
-rw-r--r--module/plugins/crypter/FilebeerInfoFolder.py4
-rw-r--r--module/plugins/crypter/FilecloudIoFolder.py18
-rw-r--r--module/plugins/crypter/FilefactoryComFolder.py56
-rw-r--r--module/plugins/crypter/FilerNetFolder.py22
-rw-r--r--module/plugins/crypter/FileserveComFolder.py10
-rw-r--r--module/plugins/crypter/FilestubeCom.py22
-rw-r--r--module/plugins/crypter/FiletramCom.py22
-rw-r--r--module/plugins/crypter/FiredriveComFolder.py28
-rw-r--r--module/plugins/crypter/FourChanOrg.py16
-rw-r--r--module/plugins/crypter/FreakhareComFolder.py19
-rw-r--r--module/plugins/crypter/FreetexthostCom.py21
-rw-r--r--module/plugins/crypter/FshareVnFolder.py4
-rw-r--r--module/plugins/crypter/GooGl.py23
-rw-r--r--module/plugins/crypter/HoerbuchIn.py18
-rw-r--r--module/plugins/crypter/HotfileFolderCom.py7
-rw-r--r--module/plugins/crypter/ILoadTo.py6
-rw-r--r--module/plugins/crypter/ImgurComAlbum.py24
-rw-r--r--module/plugins/crypter/LetitbitNetFolder.py13
-rw-r--r--module/plugins/crypter/LinkSaveIn.py23
-rw-r--r--module/plugins/crypter/LinkdecrypterCom.py45
-rw-r--r--module/plugins/crypter/LixIn.py39
-rw-r--r--module/plugins/crypter/LofCc.py4
-rw-r--r--module/plugins/crypter/MBLinkInfo.py4
-rw-r--r--module/plugins/crypter/MediafireComFolder.py31
-rw-r--r--module/plugins/crypter/Movie2kTo.py4
-rw-r--r--module/plugins/crypter/MultiUpOrg.py22
-rw-r--r--module/plugins/crypter/MultiloadCz.py28
-rw-r--r--module/plugins/crypter/MultiuploadCom.py26
-rw-r--r--module/plugins/crypter/NCryptIn.py45
-rw-r--r--module/plugins/crypter/NetfolderIn.py12
-rw-r--r--module/plugins/crypter/NosvideoCom.py6
-rw-r--r--module/plugins/crypter/OneKhDe.py9
-rwxr-xr-xmodule/plugins/crypter/OronComFolder.py4
-rw-r--r--module/plugins/crypter/PastebinCom.py18
-rw-r--r--module/plugins/crypter/QuickshareCzFolder.py16
-rw-r--r--module/plugins/crypter/RSLayerCom.py6
-rw-r--r--module/plugins/crypter/RelinkUs.py47
-rw-r--r--module/plugins/crypter/SafelinkingNet.py34
-rw-r--r--module/plugins/crypter/SecuredIn.py4
-rw-r--r--module/plugins/crypter/SerienjunkiesOrg.py62
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py12
-rw-r--r--module/plugins/crypter/ShareRapidComFolder.py4
-rw-r--r--module/plugins/crypter/SpeedLoadOrgFolder.py18
-rw-r--r--module/plugins/crypter/StealthTo.py45
-rw-r--r--module/plugins/crypter/TnyCz.py22
-rw-r--r--module/plugins/crypter/TrailerzoneInfo.py4
-rw-r--r--module/plugins/crypter/TurbobitNetFolder.py25
-rw-r--r--module/plugins/crypter/TusfilesNetFolder.py23
-rw-r--r--module/plugins/crypter/UlozToFolder.py19
-rw-r--r--module/plugins/crypter/UploadableChFolder.py21
-rw-r--r--module/plugins/crypter/UploadedToFolder.py19
-rw-r--r--module/plugins/crypter/WiiReloadedOrg.py6
-rw-r--r--module/plugins/crypter/XupPl.py7
-rw-r--r--module/plugins/crypter/YoutubeBatch.py83
-rw-r--r--module/plugins/hooks/AlldebridCom.py5
-rw-r--r--module/plugins/hooks/BypassCaptcha.py41
-rwxr-xr-xmodule/plugins/hooks/Captcha9kw.py38
-rw-r--r--module/plugins/hooks/CaptchaBrotherhood.py37
-rw-r--r--module/plugins/hooks/CaptchaTrader.py157
-rw-r--r--module/plugins/hooks/Checksum.py60
-rw-r--r--module/plugins/hooks/ClickAndLoad.py24
-rw-r--r--module/plugins/hooks/DeathByCaptcha.py41
-rw-r--r--module/plugins/hooks/DebridItaliaCom.py18
-rw-r--r--module/plugins/hooks/DeleteFinished.py39
-rw-r--r--module/plugins/hooks/DownloadScheduler.py23
-rw-r--r--module/plugins/hooks/EasybytezCom.py15
-rw-r--r--module/plugins/hooks/Ev0InFetcher.py25
-rw-r--r--module/plugins/hooks/ExpertDecoders.py35
-rw-r--r--module/plugins/hooks/ExternalScripts.py37
-rw-r--r--module/plugins/hooks/ExtractArchive.py43
-rw-r--r--module/plugins/hooks/FastixRu.py9
-rw-r--r--module/plugins/hooks/FreeWayMe.py24
-rw-r--r--module/plugins/hooks/HotFolder.py35
-rw-r--r--module/plugins/hooks/IRCInterface.py68
-rw-r--r--module/plugins/hooks/ImageTyperz.py35
-rw-r--r--module/plugins/hooks/LinkdecrypterCom.py33
-rw-r--r--module/plugins/hooks/LinksnappyCom.py8
-rw-r--r--module/plugins/hooks/MegaDebridEu.py25
-rw-r--r--module/plugins/hooks/MergeFiles.py50
-rw-r--r--module/plugins/hooks/MultiDebridCom.py22
-rw-r--r--module/plugins/hooks/MultiHome.py26
-rw-r--r--module/plugins/hooks/MultishareCz.py5
-rw-r--r--module/plugins/hooks/OverLoadMe.py5
-rw-r--r--module/plugins/hooks/Premium4Me.py4
-rw-r--r--module/plugins/hooks/PremiumizeMe.py12
-rw-r--r--module/plugins/hooks/RPNetBiz.py13
-rw-r--r--module/plugins/hooks/RealdebridCom.py4
-rw-r--r--module/plugins/hooks/RehostTo.py7
-rw-r--r--module/plugins/hooks/ReloadCc.py67
-rw-r--r--module/plugins/hooks/RestartFailed.py61
-rw-r--r--module/plugins/hooks/SimplyPremiumCom.py26
-rw-r--r--module/plugins/hooks/SimplydebridCom.py5
-rw-r--r--module/plugins/hooks/UnSkipOnFail.py32
-rw-r--r--module/plugins/hooks/UnrestrictLi.py22
-rw-r--r--module/plugins/hooks/UpdateManager.py225
-rw-r--r--module/plugins/hooks/Vipleech4uCom.py80
-rw-r--r--module/plugins/hooks/WindowsPhoneToastNotify.py29
-rw-r--r--module/plugins/hooks/XFileSharingPro.py13
-rw-r--r--module/plugins/hooks/XMPPInterface.py36
-rw-r--r--module/plugins/hooks/ZeveraCom.py5
-rw-r--r--module/plugins/hoster/AlldebridCom.py22
-rw-r--r--module/plugins/hoster/BasePlugin.py11
-rw-r--r--module/plugins/hoster/BayfilesCom.py57
-rw-r--r--module/plugins/hoster/BezvadataCz.py47
-rw-r--r--module/plugins/hoster/BillionuploadsCom.py4
-rw-r--r--module/plugins/hoster/BitshareCom.py28
-rw-r--r--module/plugins/hoster/BoltsharingCom.py4
-rw-r--r--module/plugins/hoster/CatShareNet.py18
-rw-r--r--module/plugins/hoster/CloudzerNet.py4
-rw-r--r--module/plugins/hoster/CramitIn.py7
-rw-r--r--module/plugins/hoster/CrockoCom.py29
-rw-r--r--module/plugins/hoster/CyberlockerCh.py4
-rw-r--r--module/plugins/hoster/CzshareCom.py66
-rw-r--r--module/plugins/hoster/DailymotionCom.py32
-rw-r--r--module/plugins/hoster/DataHu.py29
-rw-r--r--module/plugins/hoster/DataportCz.py37
-rw-r--r--module/plugins/hoster/DateiTo.py51
-rw-r--r--module/plugins/hoster/DdlstorageCom.py85
-rw-r--r--module/plugins/hoster/DebridItaliaCom.py19
-rw-r--r--module/plugins/hoster/DepositfilesCom.py66
-rw-r--r--module/plugins/hoster/DlFreeFr.py63
-rw-r--r--module/plugins/hoster/DuploadOrg.py18
-rw-r--r--module/plugins/hoster/EasybytezCom.py29
-rw-r--r--module/plugins/hoster/EdiskCz.py37
-rw-r--r--module/plugins/hoster/EgoFilesCom.py39
-rw-r--r--module/plugins/hoster/EpicShareNet.py8
-rw-r--r--module/plugins/hoster/EuroshareEu.py31
-rw-r--r--module/plugins/hoster/ExtabitCom.py43
-rw-r--r--module/plugins/hoster/FastixRu.py15
-rw-r--r--module/plugins/hoster/FastshareCz.py43
-rw-r--r--module/plugins/hoster/File4safeCom.py12
-rw-r--r--module/plugins/hoster/FileApeCom.py6
-rw-r--r--module/plugins/hoster/FileParadoxIn.py25
-rw-r--r--module/plugins/hoster/FileStoreTo.py24
-rw-r--r--module/plugins/hoster/FilebeerInfo.py4
-rw-r--r--module/plugins/hoster/FilecloudIo.py65
-rw-r--r--module/plugins/hoster/FilefactoryCom.py50
-rw-r--r--module/plugins/hoster/FilejungleCom.py25
-rw-r--r--module/plugins/hoster/FileomCom.py25
-rw-r--r--module/plugins/hoster/FilepostCom.py55
-rw-r--r--module/plugins/hoster/FilerNet.py38
-rw-r--r--module/plugins/hoster/FilerioCom.py7
-rw-r--r--module/plugins/hoster/FilesMailRu.py17
-rw-r--r--module/plugins/hoster/FileserveCom.py62
-rw-r--r--module/plugins/hoster/FileshareInUa.py18
-rw-r--r--module/plugins/hoster/FilezyNet.py8
-rw-r--r--module/plugins/hoster/FiredriveCom.py51
-rw-r--r--module/plugins/hoster/FlyFilesNet.py17
-rw-r--r--module/plugins/hoster/FourSharedCom.py30
-rw-r--r--module/plugins/hoster/FreakshareCom.py23
-rw-r--r--module/plugins/hoster/FreeWayMe.py22
-rw-r--r--module/plugins/hoster/FreevideoCz.py64
-rw-r--r--module/plugins/hoster/FshareVn.py35
-rw-r--r--module/plugins/hoster/Ftp.py42
-rw-r--r--module/plugins/hoster/GamefrontCom.py34
-rw-r--r--module/plugins/hoster/GigapetaCom.py36
-rw-r--r--module/plugins/hoster/GooIm.py47
-rw-r--r--module/plugins/hoster/HellshareCz.py31
-rw-r--r--module/plugins/hoster/HellspyCz.py21
-rw-r--r--module/plugins/hoster/HotfileCom.py4
-rw-r--r--module/plugins/hoster/HugefilesNet.py22
-rw-r--r--module/plugins/hoster/HundredEightyUploadCom.py22
-rw-r--r--module/plugins/hoster/IFileWs.py9
-rw-r--r--module/plugins/hoster/IcyFilesCom.py21
-rw-r--r--module/plugins/hoster/IfileIt.py41
-rw-r--r--module/plugins/hoster/IfolderRu.py29
-rw-r--r--module/plugins/hoster/JumbofilesCom.py14
-rw-r--r--module/plugins/hoster/Keep2shareCC.py36
-rw-r--r--module/plugins/hoster/LemUploadsCom.py8
-rw-r--r--module/plugins/hoster/LetitbitNet.py83
-rw-r--r--module/plugins/hoster/LinksnappyCom.py10
-rw-r--r--module/plugins/hoster/LoadTo.py77
-rw-r--r--module/plugins/hoster/LomafileCom.py61
-rw-r--r--module/plugins/hoster/LuckyShareNet.py12
-rw-r--r--module/plugins/hoster/MediafireCom.py41
-rw-r--r--module/plugins/hoster/MegaDebridEu.py37
-rw-r--r--module/plugins/hoster/MegaFilesSe.py6
-rw-r--r--module/plugins/hoster/MegaNz.py30
-rw-r--r--module/plugins/hoster/MegacrypterCom.py21
-rw-r--r--module/plugins/hoster/MegareleaseOrg.py19
-rw-r--r--module/plugins/hoster/MegasharesCom.py62
-rw-r--r--module/plugins/hoster/MovReelCom.py13
-rw-r--r--module/plugins/hoster/MultiDebridCom.py21
-rw-r--r--module/plugins/hoster/MultishareCz.py32
-rw-r--r--module/plugins/hoster/MyvideoDe.py6
-rw-r--r--module/plugins/hoster/NarodRu.py40
-rw-r--r--module/plugins/hoster/NetloadIn.py32
-rw-r--r--module/plugins/hoster/NosuploadCom.py7
-rw-r--r--module/plugins/hoster/NovafileCom.py11
-rw-r--r--module/plugins/hoster/NowDownloadEu.py50
-rw-r--r--module/plugins/hoster/OboomCom.py27
-rw-r--r--module/plugins/hoster/OneFichierCom.py24
-rw-r--r--module/plugins/hoster/OverLoadMe.py24
-rw-r--r--module/plugins/hoster/PandaPlanet.py8
-rw-r--r--module/plugins/hoster/PornhostCom.py40
-rw-r--r--module/plugins/hoster/PornhubCom.py22
-rw-r--r--module/plugins/hoster/PotloadCom.py14
-rw-r--r--module/plugins/hoster/Premium4Me.py8
-rw-r--r--module/plugins/hoster/PremiumizeMe.py12
-rw-r--r--module/plugins/hoster/PromptfileCom.py37
-rw-r--r--module/plugins/hoster/PutlockerCom.py53
-rw-r--r--module/plugins/hoster/QuickshareCz.py47
-rw-r--r--module/plugins/hoster/RPNetBiz.py8
-rw-r--r--module/plugins/hoster/RapidgatorNet.py84
-rw-r--r--module/plugins/hoster/RapidshareCom.py43
-rw-r--r--module/plugins/hoster/RarefileNet.py7
-rw-r--r--module/plugins/hoster/RealdebridCom.py23
-rw-r--r--module/plugins/hoster/RedtubeCom.py15
-rw-r--r--module/plugins/hoster/RehostTo.py8
-rw-r--r--module/plugins/hoster/ReloadCc.py115
-rw-r--r--module/plugins/hoster/RemixshareCom.py59
-rw-r--r--module/plugins/hoster/RgHostNet.py17
-rw-r--r--module/plugins/hoster/RyushareCom.py30
-rw-r--r--module/plugins/hoster/SecureUploadEu.py8
-rw-r--r--module/plugins/hoster/SendmywayCom.py4
-rw-r--r--module/plugins/hoster/SendspaceCom.py46
-rw-r--r--module/plugins/hoster/Share4webCom.py6
-rw-r--r--module/plugins/hoster/Share76Com.py6
-rw-r--r--module/plugins/hoster/ShareFilesCo.py4
-rw-r--r--module/plugins/hoster/ShareRapidCom.py42
-rw-r--r--module/plugins/hoster/SharebeesCom.py4
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py50
-rw-r--r--module/plugins/hoster/ShareplaceCom.py19
-rw-r--r--module/plugins/hoster/ShragleCom.py4
-rw-r--r--module/plugins/hoster/SimplyPremiumCom.py45
-rw-r--r--module/plugins/hoster/SimplydebridCom.py5
-rw-r--r--module/plugins/hoster/SockshareCom.py36
-rw-r--r--module/plugins/hoster/SoundcloudCom.py25
-rw-r--r--module/plugins/hoster/SpeedLoadOrg.py4
-rw-r--r--module/plugins/hoster/SpeedfileCz.py21
-rw-r--r--module/plugins/hoster/SpeedyshareCom.py43
-rw-r--r--module/plugins/hoster/StreamCz.py46
-rw-r--r--module/plugins/hoster/StreamcloudEu.py36
-rw-r--r--module/plugins/hoster/TurbobitNet.py78
-rw-r--r--module/plugins/hoster/TurbouploadCom.py21
-rw-r--r--module/plugins/hoster/TusfilesNet.py21
-rw-r--r--module/plugins/hoster/TwoSharedCom.py16
-rw-r--r--module/plugins/hoster/UlozTo.py53
-rw-r--r--module/plugins/hoster/UloziskoSk.py62
-rw-r--r--module/plugins/hoster/UnibytesCom.py51
-rw-r--r--module/plugins/hoster/UnrestrictLi.py31
-rw-r--r--module/plugins/hoster/UploadStationCom.py4
-rw-r--r--module/plugins/hoster/UploadedTo.py61
-rw-r--r--module/plugins/hoster/UploadheroCom.py57
-rw-r--r--module/plugins/hoster/UploadingCom.py55
-rw-r--r--module/plugins/hoster/UpstoreNet.py25
-rw-r--r--module/plugins/hoster/UptoboxCom.py50
-rw-r--r--module/plugins/hoster/VeehdCom.py34
-rw-r--r--module/plugins/hoster/VeohCom.py47
-rw-r--r--module/plugins/hoster/VidPlayNet.py10
-rw-r--r--module/plugins/hoster/VimeoCom.py72
-rw-r--r--module/plugins/hoster/Vipleech4uCom.py82
-rw-r--r--module/plugins/hoster/WarserverCz.py73
-rw-r--r--module/plugins/hoster/WebshareCz.py23
-rw-r--r--module/plugins/hoster/WrzucTo.py28
-rw-r--r--module/plugins/hoster/WuploadCom.py4
-rw-r--r--module/plugins/hoster/X7To.py4
-rw-r--r--module/plugins/hoster/XFileSharingPro.py113
-rw-r--r--module/plugins/hoster/XHamsterCom.py56
-rw-r--r--module/plugins/hoster/XVideosCom.py13
-rw-r--r--module/plugins/hoster/Xdcc.py69
-rw-r--r--module/plugins/hoster/YibaishiwuCom.py48
-rw-r--r--module/plugins/hoster/YoupornCom.py15
-rw-r--r--module/plugins/hoster/YourfilesTo.py17
-rw-r--r--module/plugins/hoster/YoutubeCom.py14
-rw-r--r--module/plugins/hoster/ZDF.py18
-rw-r--r--module/plugins/hoster/ZeveraCom.py5
-rw-r--r--module/plugins/hoster/ZippyshareCom.py15
-rw-r--r--module/plugins/internal/AbstractExtractor.py8
-rw-r--r--module/plugins/internal/CaptchaService.py38
-rw-r--r--module/plugins/internal/DeadCrypter.py5
-rw-r--r--module/plugins/internal/DeadHoster.py7
-rw-r--r--module/plugins/internal/MultiHoster.py31
-rw-r--r--module/plugins/internal/SimpleCrypter.py76
-rw-r--r--module/plugins/internal/SimpleHoster.py78
-rw-r--r--module/plugins/internal/UnRar.py36
-rw-r--r--module/plugins/internal/UnZip.py24
-rw-r--r--module/plugins/internal/XFSPAccount.py37
-rw-r--r--module/plugins/ocr/GigasizeCom.py17
-rw-r--r--module/plugins/ocr/LinksaveIn.py19
-rw-r--r--module/plugins/ocr/NetloadIn.py15
-rw-r--r--module/plugins/ocr/ShareonlineBiz.py33
381 files changed, 4193 insertions, 6436 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index abeafad3a..bd7f97cba 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -1,30 +1,14 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from random import choice
from time import time
from traceback import print_exc
from threading import RLock
-from Plugin import Base
+from module.plugins.Plugin import Base
from module.utils import compare_time, parseFileSize, lock
+
class WrongPassword(Exception):
pass
@@ -36,8 +20,9 @@ class Account(Base):
associated hoster plugin. Plugin should also provide `loadAccountInfo`
"""
__name__ = "Account"
- __version__ = "0.3"
__type__ = "account"
+ __version__ = "0.3"
+
__description__ = """Base account plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
@@ -84,12 +69,12 @@ class Account(Base):
self.logWarning(
_("Could not login with account %(user)s | %(msg)s") % {"user": user
, "msg": _("Wrong Password")})
- success = data["valid"] = False
+ success = data['valid'] = False
except Exception, e:
self.logWarning(
_("Could not login with account %(user)s | %(msg)s") % {"user": user
, "msg": e})
- success = data["valid"] = False
+ success = data['valid'] = False
if self.core.debug:
print_exc()
else:
@@ -119,15 +104,15 @@ class Account(Base):
""" updates account and return true if anything changed """
if user in self.accounts:
- self.accounts[user]["valid"] = True #do not remove or accounts will not login
+ self.accounts[user]['valid'] = True #do not remove or accounts will not login
if password:
- self.accounts[user]["password"] = password
+ self.accounts[user]['password'] = password
self.relogin(user)
return True
if options:
- before = self.accounts[user]["options"]
- self.accounts[user]["options"].update(options)
- return self.accounts[user]["options"] != before
+ before = self.accounts[user]['options']
+ self.accounts[user]['options'].update(options)
+ return self.accounts[user]['options'] != before
else:
self.accounts[user] = {"password": password, "options": options, "valid": True}
self._login(user, self.accounts[user])
@@ -167,7 +152,7 @@ class Account(Base):
self.logDebug("Account Info: %s" % str(infos))
- infos["timestamp"] = time()
+ infos['timestamp'] = time()
self.infos[name] = infos
elif "timestamp" in self.infos[name] and self.infos[name][
"timestamp"] + self.info_threshold * 60 < time():
@@ -179,7 +164,7 @@ class Account(Base):
def isPremium(self, user):
info = self.getAccountInfo(user)
- return info["premium"]
+ return info['premium']
def loadAccountInfo(self, name, req=None):
"""this should be overwritten in account plugin,\
@@ -192,9 +177,9 @@ class Account(Base):
return {
"validuntil": None, # -1 for unlimited
"login": name,
- #"password": self.accounts[name]["password"], #@XXX: security
- "options": self.accounts[name]["options"],
- "valid": self.accounts[name]["valid"],
+ #"password": self.accounts[name]['password'], #@XXX: security
+ "options": self.accounts[name]['options'],
+ "valid": self.accounts[name]['valid'],
"trafficleft": None, # in kb, -1 for unlimited
"maxtraffic": None,
"premium": True, #useful for free accounts
@@ -230,12 +215,12 @@ class Account(Base):
""" returns an valid account name and data"""
usable = []
for user, data in self.accounts.iteritems():
- if not data["valid"]: continue
+ if not data['valid']: continue
- if "time" in data["options"] and data["options"]["time"]:
+ if "time" in data['options'] and data['options']['time']:
time_data = ""
try:
- time_data = data["options"]["time"][0]
+ time_data = data['options']['time'][0]
start, end = time_data.split("-")
if not compare_time(start.split(":"), end.split(":")):
continue
@@ -244,10 +229,10 @@ class Account(Base):
if user in self.infos:
if "validuntil" in self.infos[user]:
- if self.infos[user]["validuntil"] > 0 and time() > self.infos[user]["validuntil"]:
+ if self.infos[user]['validuntil'] > 0 and time() > self.infos[user]['validuntil']:
continue
if "trafficleft" in self.infos[user]:
- if self.infos[user]["trafficleft"] == 0:
+ if self.infos[user]['trafficleft'] == 0:
continue
usable.append((user, data))
diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py
index 9bbf8bfd0..6c908738c 100644
--- a/module/plugins/AccountManager.py
+++ b/module/plugins/AccountManager.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
-"""
-
from os.path import exists
from shutil import copy
@@ -27,6 +10,7 @@ from module.utils import chmod, lock
ACC_VERSION = 1
+
class AccountManager:
"""manages all accounts"""
@@ -47,7 +31,6 @@ class AccountManager:
self.initAccountPlugins()
self.loadAccounts()
-
def getAccountPlugin(self, plugin):
"""get account instance for plugin or None if anonymous"""
if plugin in self.accounts:
@@ -109,7 +92,7 @@ class AccountManager:
elif line.startswith("@"):
try:
option = line[1:].split()
- self.accounts[plugin][name]["options"][option[0]] = [] if len(option) < 2 else ([option[1]] if len(option) < 3 else option[1:])
+ self.accounts[plugin][name]['options'][option[0]] = [] if len(option) < 2 else ([option[1]] if len(option) < 3 else option[1:])
except:
pass
@@ -129,9 +112,9 @@ class AccountManager:
f.write(plugin+":\n")
for name,data in accounts.iteritems():
- f.write("\n\t%s:%s\n" % (name,data["password"]) )
- if data["options"]:
- for option, values in data["options"].iteritems():
+ f.write("\n\t%s:%s\n" % (name,data['password']) )
+ if data['options']:
+ for option, values in data['options'].iteritems():
f.write("\t@%s %s\n" % (option, " ".join(values)))
f.close()
diff --git a/module/plugins/Container.py b/module/plugins/Container.py
index 685ceac20..63804d713 100644
--- a/module/plugins/Container.py
+++ b/module/plugins/Container.py
@@ -1,33 +1,21 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
+import re
- @author: mkaay
-"""
+from os import remove
+from os.path import basename, exists
from module.plugins.Crypter import Crypter
+from module.utils import save_join
-from os.path import join, exists, basename
-from os import remove
-import re
class Container(Crypter):
__name__ = "Container"
+ __type__ = "container"
__version__ = "0.1"
+
__pattern__ = None
- __type__ = "container"
+
__description__ = """Base container decrypter plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
@@ -48,13 +36,13 @@ class Container(Crypter):
def loadToDisk(self):
- """loads container to disk if its stored remotely and overwrite url,
+ """loads container to disk if its stored remotely and overwrite url,
or check existent on several places at disk"""
if self.pyfile.url.startswith("http"):
self.pyfile.name = re.findall("([^\/=]+)", self.pyfile.url)[-1]
content = self.load(self.pyfile.url)
- self.pyfile.url = join(self.config["general"]["download_folder"], self.pyfile.name)
+ self.pyfile.url = save_join(self.config['general']['download_folder'], self.pyfile.name)
f = open(self.pyfile.url, "wb" )
f.write(content)
f.close()
@@ -62,8 +50,8 @@ class Container(Crypter):
else:
self.pyfile.name = basename(self.pyfile.url)
if not exists(self.pyfile.url):
- if exists(join(pypath, self.pyfile.url)):
- self.pyfile.url = join(pypath, self.pyfile.url)
+ if exists(save_join(pypath, self.pyfile.url)):
+ self.pyfile.url = save_join(pypath, self.pyfile.url)
else:
self.fail(_("File not exists."))
diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py
index 6a0fd467b..b127777e7 100644
--- a/module/plugins/Crypter.py
+++ b/module/plugins/Crypter.py
@@ -5,9 +5,11 @@ from module.plugins.Plugin import Plugin
class Crypter(Plugin):
__name__ = "Crypter"
+ __type__ = "crypter"
__version__ = "0.1"
+
__pattern__ = None
- __type__ = "crypter"
+
__description__ = """Base decrypter plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py
index 90b683d75..e72ab7ebb 100644
--- a/module/plugins/Hook.py
+++ b/module/plugins/Hook.py
@@ -1,26 +1,9 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
- @interface-version: 0.2
-"""
-
from traceback import print_exc
-from Plugin import Base
+from module.plugins.Plugin import Base
+
class Expose(object):
""" used for decoration to declare rpc services """
@@ -29,19 +12,24 @@ class Expose(object):
hookManager.addRPC(f.__module__, f.func_name, f.func_doc)
return f
+
def threaded(f):
+
def run(*args,**kwargs):
hookManager.startThread(f, *args, **kwargs)
return run
+
class Hook(Base):
"""
Base class for hook plugins.
"""
__name__ = "Hook"
- __version__ = "0.2"
__type__ = "hook"
+ __version__ = "0.2"
+
__config__ = [("name", "type", "desc", "default")]
+
__description__ = """Interface for hook"""
__author_name__ = ("mkaay", "RaNaN")
__author_mail__ = ("mkaay@mkaay.de", "RaNaN@pyload.org")
@@ -53,10 +41,10 @@ class Hook(Base):
#: List of events the plugin can handle, name the functions exactly like eventname.
event_list = None # dont make duplicate entries in event_map
-
- #: periodic call interval in seconds
+ #: periodic call interval in secondc
interval = 60
+
def __init__(self, core, manager):
Base.__init__(self, core)
@@ -122,7 +110,7 @@ class Hook(Base):
return self.config.getPlugin(self.__name__, "activated")
- #event methods - overwrite these if needed
+ #event methods - overwrite these if needed
def coreReady(self):
pass
diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py
index 4979d383b..bedfce129 100644
--- a/module/plugins/Hoster.py
+++ b/module/plugins/Hoster.py
@@ -1,33 +1,20 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from module.plugins.Plugin import Plugin
+
def getInfo(self):
#result = [ .. (name, size, status, url) .. ]
return
+
class Hoster(Plugin):
__name__ = "Hoster"
+ __type__ = "hoster"
__version__ = "0.1"
+
__pattern__ = None
- __type__ = "hoster"
+
__description__ = """Base hoster plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
diff --git a/module/plugins/OCR.py b/module/plugins/OCR.py
index eb4456fc0..0991184f3 100644
--- a/module/plugins/OCR.py
+++ b/module/plugins/OCR.py
@@ -1,29 +1,11 @@
# -*- coding: utf-8 -*-
-#
-#Copyright (C) 2009 kingzero, RaNaN
-#
-#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/>.
-#
-###
from __future__ import with_statement
import os
-from os.path import join
-from os.path import abspath
import logging
import subprocess
+from os.path import abspath, join
from PIL import Image
from PIL import TiffImagePlugin
from PIL import PngImagePlugin
@@ -33,6 +15,13 @@ from PIL import JpegImagePlugin
class OCR(object):
__name__ = "OCR"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """OCR base plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
def __init__(self):
self.logger = logging.getLogger("log")
@@ -142,7 +131,7 @@ class OCR(object):
for y in xrange(h):
if pixels[x, y] == 255:
continue
- # no point in processing white pixels since we only want to remove black pixel
+ # No point in processing white pixels since we only want to remove black pixel
count = 0
try:
@@ -173,7 +162,8 @@ class OCR(object):
# second pass: this time set all 1's to 255 (white)
for x in xrange(w):
for y in xrange(h):
- if pixels[x, y] == 1: pixels[x, y] = 255
+ if pixels[x, y] == 1:
+ pixels[x, y] = 255
self.pixels = pixels
@@ -267,13 +257,16 @@ class OCR(object):
firstX = x
lastX = x
- if y > bottomY: bottomY = y
- if y < topY: topY = y
- if x > lastX: lastX = x
+ if y > bottomY:
+ bottomY = y
+ if y < topY:
+ topY = y
+ if x > lastX:
+ lastX = x
black_pixel_in_col = True
- if black_pixel_in_col == False and started == True:
+ if black_pixel_in_col is False and started is True:
rect = (firstX, topY, lastX, bottomY)
new_captcha = captcha.crop(rect)
@@ -287,7 +280,6 @@ class OCR(object):
return letters
def correct(self, values, var=None):
-
if var:
result = var
else:
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index d23c0cfcb..8a2554ea0 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN, spoob, mkaay
-"""
-
from time import time, sleep
from random import randint
@@ -143,14 +126,17 @@ class Plugin(Base):
Overwrite `process` / `decrypt` in your subclassed plugin.
"""
__name__ = "Plugin"
+ __type__ = "hoster"
__version__ = "0.5"
+
__pattern__ = None
- __type__ = "hoster"
__config__ = [("name", "type", "desc", "default")]
+
__description__ = """Base plugin"""
__author_name__ = ("RaNaN", "spoob", "mkaay")
__author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org", "mkaay@mkaay.de")
+
def __init__(self, pyfile):
Base.__init__(self, pyfile.m.core)
@@ -225,8 +211,8 @@ class Plugin(Base):
def getChunkCount(self):
if self.chunkLimit <= 0:
- return self.config["download"]["chunks"]
- return min(self.config["download"]["chunks"], self.chunkLimit)
+ return self.config['download']['chunks']
+ return min(self.config['download']['chunks'], self.chunkLimit)
def __call__(self):
return self.__name__
@@ -504,12 +490,12 @@ class Plugin(Base):
location = safe_join(download_folder, self.pyfile.package().folder)
if not exists(location):
- makedirs(location, int(self.config["permission"]["folder"], 8))
+ makedirs(location, int(self.config['permission']['folder'], 8))
- if self.config["permission"]["change_dl"] and os.name != "nt":
+ if self.config['permission']['change_dl'] and os.name != "nt":
try:
- uid = getpwnam(self.config["permission"]["user"])[2]
- gid = getgrnam(self.config["permission"]["group"])[2]
+ uid = getpwnam(self.config['permission']['user'])[2]
+ gid = getgrnam(self.config['permission']['group'])[2]
chown(location, uid, gid)
except Exception, e:
@@ -537,13 +523,13 @@ class Plugin(Base):
fs_filename = fs_encode(filename)
- if self.config["permission"]["change_file"]:
- chmod(fs_filename, int(self.config["permission"]["file"], 8))
+ if self.config['permission']['change_file']:
+ chmod(fs_filename, int(self.config['permission']['file'], 8))
- if self.config["permission"]["change_dl"] and os.name != "nt":
+ if self.config['permission']['change_dl'] and os.name != "nt":
try:
- uid = getpwnam(self.config["permission"]["user"])[2]
- gid = getgrnam(self.config["permission"]["group"])[2]
+ uid = getpwnam(self.config['permission']['user'])[2]
+ gid = getgrnam(self.config['permission']['group'])[2]
chown(fs_filename, uid, gid)
except Exception, e:
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py
index 1e1656ce8..32ea4d16b 100644
--- a/module/plugins/PluginManager.py
+++ b/module/plugins/PluginManager.py
@@ -1,34 +1,19 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, RaNaN
-"""
-
import re
import sys
+from itertools import chain
from os import listdir, makedirs
from os.path import isfile, join, exists, abspath
from sys import version_info
-from itertools import chain
from traceback import print_exc
from module.lib.SafeEval import const_eval as literal_eval
+
from module.ConfigParser import IGNORE
+
class PluginManager:
ROOT = "module.plugins."
USERROOT = "userplugins."
@@ -64,20 +49,20 @@ class PluginManager:
f = open(join("userplugins", "__init__.py"), "wb")
f.close()
- self.plugins["crypter"] = self.crypterPlugins = self.parse("crypter", pattern=True)
- self.plugins["container"] = self.containerPlugins = self.parse("container", pattern=True)
- self.plugins["hoster"] = self.hosterPlugins = self.parse("hoster", pattern=True)
+ self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True)
+ self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True)
+ self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True)
- self.plugins["ocr"] = self.captchaPlugins = self.parse("ocr")
- self.plugins["accounts"] = self.accountPlugins = self.parse("accounts")
- self.plugins["hooks"] = self.hookPlugins = self.parse("hooks")
- self.plugins["internal"] = self.internalPlugins = self.parse("internal")
+ self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr")
+ self.plugins['accounts'] = self.accountPlugins = self.parse("accounts")
+ self.plugins['hooks'] = self.hookPlugins = self.parse("hooks")
+ self.plugins['internal'] = self.internalPlugins = self.parse("internal")
self.log.debug("created index of plugins")
def parse(self, folder, pattern=False, home={}):
"""
- returns dict with information
+ returns dict with information
home contains parsed plugins from module.
{
@@ -122,20 +107,20 @@ class PluginManager:
# home contains plugins from pyload root
if home and name in home:
- if home[name]["v"] >= version:
+ if home[name]['v'] >= version:
continue
if name in IGNORE or (folder, name) in IGNORE:
continue
plugins[name] = {}
- plugins[name]["v"] = version
+ plugins[name]['v'] = version
module = f.replace(".pyc", "").replace(".py", "")
# the plugin is loaded from user directory
- plugins[name]["user"] = True if home else False
- plugins[name]["name"] = module
+ plugins[name]['user'] = True if home else False
+ plugins[name]['name'] = module
if pattern:
pattern = self.PATTERN.findall(content)
@@ -145,10 +130,10 @@ class PluginManager:
else:
pattern = "^unmachtable$"
- plugins[name]["pattern"] = pattern
+ plugins[name]['pattern'] = pattern
try:
- plugins[name]["re"] = re.compile(pattern)
+ plugins[name]['re'] = re.compile(pattern)
except:
self.log.error(_("%s has a invalid pattern.") % name)
@@ -209,13 +194,13 @@ class PluginManager:
if type(url) not in (str, unicode, buffer): continue
found = False
- if last and last[1]["re"].match(url):
+ if last and last[1]['re'].match(url):
res.append((url, last[0]))
continue
for name, value in chain(self.crypterPlugins.iteritems(), self.hosterPlugins.iteritems(),
self.containerPlugins.iteritems()):
- if value["re"].match(url):
+ if value['re'].match(url):
res.append((url, name))
last = (name, value)
found = True
@@ -238,10 +223,10 @@ class PluginManager:
if not plugin:
self.log.warning("Plugin %s not found." % name)
- plugin = self.hosterPlugins["BasePlugin"]
+ plugin = self.hosterPlugins['BasePlugin']
if "new_module" in plugin and not original:
- return plugin["new_module"]
+ return plugin['new_module']
return self.loadModule(type, name)
@@ -250,7 +235,7 @@ class PluginManager:
plugin, type = self.findPlugin(name)
if "new_name" in plugin:
- return plugin["new_name"]
+ return plugin['new_name']
return name
@@ -262,11 +247,11 @@ class PluginManager:
"""
plugins = self.plugins[type]
if name in plugins:
- if "module" in plugins[name]: return plugins[name]["module"]
+ if "module" in plugins[name]: return plugins[name]['module']
try:
- module = __import__(self.ROOT + "%s.%s" % (type, plugins[name]["name"]), globals(), locals(),
- plugins[name]["name"])
- plugins[name]["module"] = module #cache import, maybe unneeded
+ module = __import__(self.ROOT + "%s.%s" % (type, plugins[name]['name']), globals(), locals(),
+ plugins[name]['name'])
+ plugins[name]['module'] = module #cache import, maybe unneeded
return module
except Exception, e:
self.log.error(_("Error importing %(name)s: %(msg)s") % {"name": name, "msg": str(e)})
@@ -294,10 +279,10 @@ class PluginManager:
if type in self.plugins and name in self.plugins[type]:
#userplugin is a newer version
- if not user and self.plugins[type][name]["user"]:
+ if not user and self.plugins[type][name]['user']:
return self
#imported from userdir, but pyloads is newer
- if user and not self.plugins[type][name]["user"]:
+ if user and not self.plugins[type][name]['user']:
return self
@@ -346,7 +331,7 @@ class PluginManager:
self.log.debug("Reloading %s" % plugin)
id = (type, plugin)
try:
- reload(self.plugins[type][plugin]["module"])
+ reload(self.plugins[type][plugin]['module'])
except Exception, e:
self.log.error("Error when reloading %s" % id, str(e))
continue
@@ -354,11 +339,11 @@ class PluginManager:
reloaded.append(id)
#index creation
- self.plugins["crypter"] = self.crypterPlugins = self.parse("crypter", pattern=True)
- self.plugins["container"] = self.containerPlugins = self.parse("container", pattern=True)
- self.plugins["hoster"] = self.hosterPlugins = self.parse("hoster", pattern=True)
- self.plugins["ocr"] = self.captchaPlugins = self.parse("ocr")
- self.plugins["accounts"] = self.accountPlugins = self.parse("accounts")
+ self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True)
+ self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True)
+ self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True)
+ self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr")
+ self.plugins['accounts'] = self.accountPlugins = self.parse("accounts")
if "accounts" in as_dict: #: accounts needs to be reloaded
self.core.accountManager.initPlugins()
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py
index acfb6874a..dbf4ad800 100644
--- a/module/plugins/accounts/AlldebridCom.py
+++ b/module/plugins/accounts/AlldebridCom.py
@@ -1,27 +1,31 @@
# -*- coding: utf-8 -*-
+import re
import xml.dom.minidom as dom
+
from time import time
-import re
-import urllib
+from urllib import urlencode
-from module.plugins.Account import Account
from BeautifulSoup import BeautifulSoup
+from module.plugins.Account import Account
+
class AlldebridCom(Account):
__name__ = "AlldebridCom"
- __version__ = "0.22"
__type__ = "account"
+ __version__ = "0.22"
+
__description__ = """AllDebrid.com account plugin"""
__author_name__ = "Andy Voigt"
__author_mail__ = "spamsales@online.de"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
page = req.load("http://www.alldebrid.com/account/")
soup = BeautifulSoup(page)
- #Try to parse expiration date directly from the control panel page (better accuracy)
+ #Try to parse expiration date directly from the control panel page (better accuracy)
try:
time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string
self.logDebug("Account expires in: %s" % time_text)
@@ -33,7 +37,7 @@ class AlldebridCom(Account):
except:
data = self.getAccountData(user)
page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user,
- data["password"]))
+ data['password']))
self.logDebug(page)
xml = dom.parseString(page)
exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60
@@ -41,7 +45,7 @@ class AlldebridCom(Account):
return account_info
def login(self, user, data, req):
- urlparams = urllib.urlencode({'action': 'login', 'login_login': user, 'login_password': data["password"]})
+ urlparams = urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']})
page = req.load("http://www.alldebrid.com/register/?%s" % urlparams)
if "This login doesn't exist" in page:
diff --git a/module/plugins/accounts/BayfilesCom.py b/module/plugins/accounts/BayfilesCom.py
index bbd81e10b..7c4708f7d 100644
--- a/module/plugins/accounts/BayfilesCom.py
+++ b/module/plugins/accounts/BayfilesCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from time import time
from module.plugins.Account import Account
@@ -25,27 +8,29 @@ from module.common.json_layer import json_loads
class BayfilesCom(Account):
__name__ = "BayfilesCom"
- __version__ = "0.03"
__type__ = "account"
+ __version__ = "0.03"
+
__description__ = """Bayfiles.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def loadAccountInfo(self, user, req):
for _ in xrange(2):
response = json_loads(req.load("http://api.bayfiles.com/v1/account/info"))
self.logDebug(response)
- if not response["error"]:
+ if not response['error']:
break
- self.logWarning(response["error"])
+ self.logWarning(response['error'])
self.relogin(user)
return {"premium": bool(response['premium']), "trafficleft": -1,
"validuntil": response['expires'] if response['expires'] >= int(time()) else -1}
def login(self, user, data, req):
- response = json_loads(req.load("http://api.bayfiles.com/v1/account/login/%s/%s" % (user, data["password"])))
+ response = json_loads(req.load("http://api.bayfiles.com/v1/account/login/%s/%s" % (user, data['password'])))
self.logDebug(response)
- if response["error"]:
- self.logError(response["error"])
+ if response['error']:
+ self.logError(response['error'])
self.wrongPassword()
diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py
index 4fe01aa5b..272bbeb6e 100644
--- a/module/plugins/accounts/BitshareCom.py
+++ b/module/plugins/accounts/BitshareCom.py
@@ -1,32 +1,17 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: pking
-"""
-
from module.plugins.Account import Account
class BitshareCom(Account):
__name__ = "BitshareCom"
- __version__ = "0.12"
__type__ = "account"
+ __version__ = "0.12"
+
__description__ = """Bitshare account plugin"""
__author_name__ = "Paul King"
- __author_mail__ = ""
+ __author_mail__ = None
+
def loadAccountInfo(self, user, req):
page = req.load("http://bitshare.com/mysettings.html")
@@ -41,6 +26,6 @@ class BitshareCom(Account):
def login(self, user, data, req):
page = req.load("http://bitshare.com/login.html",
- post={"user": user, "password": data["password"], "submit": "Login"}, cookies=True)
+ post={"user": user, "password": data['password'], "submit": "Login"}, cookies=True)
if "login" in req.lastEffectiveURL:
self.wrongPassword()
diff --git a/module/plugins/accounts/CramitIn.py b/module/plugins/accounts/CramitIn.py
index 56cb5390b..34aa3ab40 100644
--- a/module/plugins/accounts/CramitIn.py
+++ b/module/plugins/accounts/CramitIn.py
@@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class CramitIn(XFSPAccount):
__name__ = "CramitIn"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Cramit.in account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/accounts/CyberlockerCh.py b/module/plugins/accounts/CyberlockerCh.py
index 4f3189b0c..729975fb0 100644
--- a/module/plugins/accounts/CyberlockerCh.py
+++ b/module/plugins/accounts/CyberlockerCh.py
@@ -6,14 +6,16 @@ from module.plugins.internal.SimpleHoster import parseHtmlForm
class CyberlockerCh(XFSPAccount):
__name__ = "CyberlockerCh"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Cyberlocker.ch account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
MAIN_PAGE = "http://cyberlocker.ch/"
+
def login(self, user, data, req):
html = req.load(self.MAIN_PAGE + 'login.html', decode=True)
diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py
index bdd2000c9..6f2ee641e 100644
--- a/module/plugins/accounts/CzshareCom.py
+++ b/module/plugins/accounts/CzshareCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from time import mktime, strptime
import re
@@ -25,30 +8,32 @@ from module.plugins.Account import Account
class CzshareCom(Account):
__name__ = "CzshareCom"
- __version__ = "0.14"
__type__ = "account"
+ __version__ = "0.14"
+
__description__ = """Czshare.com account plugin, now Sdilej.cz"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
CREDIT_LEFT_PATTERN = r'<tr class="active">\s*<td>([0-9 ,]+) (KiB|MiB|GiB)</td>\s*<td>([^<]*)</td>\s*</tr>'
+
def loadAccountInfo(self, user, req):
html = req.load("http://sdilej.cz/prehled_kreditu/")
- found = re.search(self.CREDIT_LEFT_PATTERN, html)
- if not found:
+ m = re.search(self.CREDIT_LEFT_PATTERN, html)
+ if m is None:
return {"validuntil": 0, "trafficleft": 0}
else:
- credits = float(found.group(1).replace(' ', '').replace(',', '.'))
- credits = credits * 1024 ** {'KiB': 0, 'MiB': 1, 'GiB': 2}[found.group(2)]
- validuntil = mktime(strptime(found.group(3), '%d.%m.%y %H:%M'))
+ credits = float(m.group(1).replace(' ', '').replace(',', '.'))
+ credits = credits * 1024 ** {'KiB': 0, 'MiB': 1, 'GiB': 2}[m.group(2)]
+ validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M'))
return {"validuntil": validuntil, "trafficleft": credits}
def login(self, user, data, req):
html = req.load('https://sdilej.cz/index.php', post={
"Prihlasit": "Prihlasit",
- "login-password": data["password"],
+ "login-password": data['password'],
"login-name": user
})
diff --git a/module/plugins/accounts/DdlstorageCom.py b/module/plugins/accounts/DdlstorageCom.py
deleted file mode 100644
index f3eebc59b..000000000
--- a/module/plugins/accounts/DdlstorageCom.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from hashlib import md5
-from time import mktime, strptime
-
-from module.plugins.internal.XFSPAccount import XFSPAccount
-from module.common.json_layer import json_loads
-from module.utils import parseFileSize
-
-# DDLStorage API Documentation:
-# http://www.ddlstorage.com/cgi-bin/api_req.cgi?req_type=doc
-
-
-class DdlstorageCom(XFSPAccount):
- __name__ = "DdlstorageCom"
- __version__ = "1.00"
- __type__ = "account"
- __description__ = """DDLStorage.com account plugin"""
- __author_name__ = "stickell"
- __author_mail__ = "l.stickell@yahoo.it"
-
- MAIN_PAGE = "http://ddlstorage.com/"
-
- def loadAccountInfo(self, user, req):
- password = self.accounts[user]['password']
- api_data = req.load('http://www.ddlstorage.com/cgi-bin/api_req.cgi',
- post={'req_type': 'user_info',
- 'client_id': 53472,
- 'user_login': user,
- 'user_password': md5(password).hexdigest(),
- 'sign': md5('user_info%d%s%s%s' % (53472, user, md5(password).hexdigest(),
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()})
- api_data = api_data.replace('<pre>', '').replace('</pre>', '')
- self.logDebug('Account Info API data: ' + api_data)
- api_data = json_loads(api_data)
-
- if api_data['status'] != 'OK': # 'status' must be always OK for a working account
- return {"premium": False, "valid": False}
-
- if api_data['account_type'] == 'REGISTERED':
- premium = False
- validuntil = None
- else:
- premium = True
- validuntil = int(mktime(strptime(api_data['premium_expire'], "%Y-%m-%d %H:%M:%S")))
-
- if api_data['usr_bandwidth_available'] == 'UNLIMITED':
- trafficleft = -1
- else:
- trafficleft = parseFileSize(api_data['usr_bandwidth_available']) / 1024
-
- return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft}
diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py
index dd714102f..f4441c356 100644
--- a/module/plugins/accounts/DebridItaliaCom.py
+++ b/module/plugins/accounts/DebridItaliaCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
import time
@@ -22,14 +8,16 @@ from module.plugins.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Debriditalia.com account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
WALID_UNTIL_PATTERN = r"Premium valid till: (?P<D>[^|]+) \|"
+
def loadAccountInfo(self, user, req):
if 'Account premium not activated' in self.html:
return {"premium": False, "validuntil": None, "trafficleft": None}
@@ -43,6 +31,6 @@ class DebridItaliaCom(Account):
def login(self, user, data, req):
self.html = req.load("http://debriditalia.com/login.php",
- get={"u": user, "p": data["password"]})
+ get={"u": user, "p": data['password']})
if 'NO' in self.html:
self.wrongPassword()
diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py
index 427f5c34d..01f1906f4 100644
--- a/module/plugins/accounts/DepositfilesCom.py
+++ b/module/plugins/accounts/DepositfilesCom.py
@@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
import re
+
from time import strptime, mktime
from module.plugins.Account import Account
@@ -25,14 +9,16 @@ from module.plugins.Account import Account
class DepositfilesCom(Account):
__name__ = "DepositfilesCom"
- __version__ = "0.2"
__type__ = "account"
+ __version__ = "0.3"
+
__description__ = """Depositfiles.com account plugin"""
- __author_name__ = ("mkaay", "stickell")
- __author_mail__ = ("mkaay@mkaay.de", "l.stickell@yahoo.it")
+ __author_name__ = ("mkaay", "stickell", "Walter Purcaro")
+ __author_mail__ = ("mkaay@mkaay.de", "l.stickell@yahoo.it", "vuolter@gmail.com")
+
def loadAccountInfo(self, user, req):
- src = req.load("http://depositfiles.com/de/gold/")
+ src = req.load("https://dfiles.eu/de/gold/")
validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", src).group(1)
validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")))
@@ -40,8 +26,7 @@ class DepositfilesCom(Account):
return {"validuntil": validuntil, "trafficleft": -1}
def login(self, user, data, req):
- req.load("http://depositfiles.com/de/gold/payment.php")
- src = req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"},
- post={"login": user, "password": data["password"]})
+ src = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"},
+ post={"login": user, "password": data['password']})
if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in src:
self.wrongPassword()
diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py
index 16ce674e2..3b8517686 100644
--- a/module/plugins/accounts/EasybytezCom.py
+++ b/module/plugins/accounts/EasybytezCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from time import mktime, strptime, gmtime
@@ -27,8 +10,9 @@ from module.utils import parseFileSize
class EasybytezCom(Account):
__name__ = "EasybytezCom"
- __version__ = "0.04"
__type__ = "account"
+ __version__ = "0.04"
+
__description__ = """EasyBytez.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -36,26 +20,27 @@ class EasybytezCom(Account):
VALID_UNTIL_PATTERN = r'Premium account expire:</TD><TD><b>([^<]+)</b>'
TRAFFIC_LEFT_PATTERN = r'<TR><TD>Traffic available today:</TD><TD><b>(?P<S>[^<]+)</b>'
+
def loadAccountInfo(self, user, req):
html = req.load("http://www.easybytez.com/?op=my_account", decode=True)
validuntil = trafficleft = None
premium = False
- found = re.search(self.VALID_UNTIL_PATTERN, html)
- if found:
+ m = re.search(self.VALID_UNTIL_PATTERN, html)
+ if m:
try:
- self.logDebug("Expire date: " + found.group(1))
- validuntil = mktime(strptime(found.group(1), "%d %B %Y"))
+ self.logDebug("Expire date: " + m.group(1))
+ validuntil = mktime(strptime(m.group(1), "%d %B %Y"))
except Exception, e:
self.logError(e)
if validuntil > mktime(gmtime()):
premium = True
trafficleft = -1
else:
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if found:
- trafficleft = found.group(1)
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ if m:
+ trafficleft = m.group(1)
if "Unlimited" in trafficleft:
trafficleft = -1
else:
diff --git a/module/plugins/accounts/EgoFilesCom.py b/module/plugins/accounts/EgoFilesCom.py
index e5c781068..41b58c4e7 100644
--- a/module/plugins/accounts/EgoFilesCom.py
+++ b/module/plugins/accounts/EgoFilesCom.py
@@ -9,14 +9,16 @@ from module.utils import parseFileSize
class EgoFilesCom(Account):
__name__ = "EgoFilesCom"
- __version__ = "0.2"
__type__ = "account"
+ __version__ = "0.2"
+
__description__ = """Egofiles.com account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
PREMIUM_ACCOUNT_PATTERN = '<br/>\s*Premium: (?P<P>[^/]*) / Traffic left: (?P<T>[\d.]*) (?P<U>\w*)\s*\\n\s*<br/>'
+
def loadAccountInfo(self, user, req):
html = req.load("http://egofiles.com")
if 'You are logged as a Free User' in html:
@@ -37,6 +39,6 @@ class EgoFilesCom(Account):
html = req.load("http://egofiles.com/ajax/register.php",
post={"log": 1,
"loginV": user,
- "passV": data["password"]})
+ "passV": data['password']})
if 'Login successful' not in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py
index 3fb0d7f50..f37693206 100644
--- a/module/plugins/accounts/EuroshareEu.py
+++ b/module/plugins/accounts/EuroshareEu.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from time import mktime, strptime
import re
@@ -25,22 +8,24 @@ from module.plugins.Account import Account
class EuroshareEu(Account):
__name__ = "EuroshareEu"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Euroshare.eu account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def loadAccountInfo(self, user, req):
self.relogin(user)
html = req.load("http://euroshare.eu/customer-zone/settings/")
- found = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html)
- if found is None:
+ m = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html)
+ if m is None:
premium, validuntil = False, -1
else:
premium = True
- validuntil = mktime(strptime(found.group(1), "%d.%m.%Y %H:%M"))
+ validuntil = mktime(strptime(m.group(1), "%d.%m.%Y %H:%M"))
return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
@@ -49,7 +34,7 @@ class EuroshareEu(Account):
html = req.load('http://euroshare.eu/customer-zone/login/', post={
"trvale": "1",
"login": user,
- "password": data["password"]
+ "password": data['password']
}, decode=True)
if u">Nesprávne prihlasovacie meno alebo heslo" in html:
diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py
index dbfd1f33e..7e46ccd05 100644
--- a/module/plugins/accounts/FastixRu.py
+++ b/module/plugins/accounts/FastixRu.py
@@ -6,15 +6,17 @@ from module.common.json_layer import json_loads
class FastixRu(Account):
__name__ = "FastixRu"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """Fastix account plugin"""
__author_name__ = "Massimo Rosamilia"
__author_mail__ = "max@spiritix.eu"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data["api"]))
+ page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api']))
page = json_loads(page)
points = page['points']
kb = float(points)
@@ -26,9 +28,9 @@ class FastixRu(Account):
return account_info
def login(self, user, data, req):
- page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data["password"]))
+ page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password']))
api = json_loads(page)
api = api['apikey']
- data["api"] = api
+ data['api'] = api
if "error_code" in page:
self.wrongPassword()
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index ba6105e6e..a968be19e 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Account import Account
from module.utils import parseFileSize
@@ -24,20 +7,22 @@ from module.utils import parseFileSize
class FastshareCz(Account):
__name__ = "FastshareCz"
- __version__ = "0.03"
__type__ = "account"
+ __version__ = "0.03"
+
__description__ = """Fastshare.cz account plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
CREDIT_PATTERN = r'(?:Kredit|Credit)\s*</td>\s*<td[^>]*>([\d. \w]+)&nbsp;'
+
def loadAccountInfo(self, user, req):
html = req.load("http://www.fastshare.cz/user", decode=True)
- found = re.search(self.CREDIT_PATTERN, html)
- if found:
- trafficleft = parseFileSize(found.group(1)) / 1024
+ m = re.search(self.CREDIT_PATTERN, html)
+ if m:
+ trafficleft = parseFileSize(m.group(1)) / 1024
premium = True if trafficleft else False
else:
trafficleft = None
diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4safeCom.py
index 6a11493d2..aa7894e98 100644
--- a/module/plugins/accounts/File4safeCom.py
+++ b/module/plugins/accounts/File4safeCom.py
@@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class File4safeCom(XFSPAccount):
__name__ = "File4safeCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """File4safe.com account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py
index f2becb8c9..ec98cf9b2 100644
--- a/module/plugins/accounts/FilecloudIo.py
+++ b/module/plugins/accounts/FilecloudIo.py
@@ -1,34 +1,19 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.Account import Account
from module.common.json_layer import json_loads
class FilecloudIo(Account):
__name__ = "FilecloudIo"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """FilecloudIo account plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
def loadAccountInfo(self, user, req):
# It looks like the first API request always fails, so we retry 5 times, it should work on the second try
for _ in xrange(5):
@@ -50,7 +35,7 @@ class FilecloudIo(Account):
rep = json_loads(rep)
if rep['is_premium'] == 1:
- return {"validuntil": int(rep["premium_until"]), "trafficleft": -1}
+ return {"validuntil": int(rep['premium_until']), "trafficleft": -1}
else:
return {"premium": False}
@@ -61,8 +46,8 @@ class FilecloudIo(Account):
if not hasattr(self, "form_data"):
self.form_data = {}
- self.form_data["username"] = user
- self.form_data["password"] = data['password']
+ self.form_data['username'] = user
+ self.form_data['password'] = data['password']
html = req.load('https://secure.filecloud.io/user-login_p.html',
post=self.form_data,
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py
index 0eded0edf..84d80cab7 100644
--- a/module/plugins/accounts/FilefactoryCom.py
+++ b/module/plugins/accounts/FilefactoryCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
from time import mktime, strptime
@@ -24,14 +10,16 @@ from module.plugins.Account import Account
class FilefactoryCom(Account):
__name__ = "FilefactoryCom"
- __version__ = "0.14"
__type__ = "account"
+ __version__ = "0.14"
+
__description__ = """Filefactory.com account plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
VALID_UNTIL_PATTERN = r'Premium valid until: <strong>(?P<d>\d{1,2})\w{1,2} (?P<m>\w{3}), (?P<y>\d{4})</strong>'
+
def loadAccountInfo(self, user, req):
html = req.load("http://www.filefactory.com/account/")
@@ -51,7 +39,7 @@ class FilefactoryCom(Account):
html = req.load("http://www.filefactory.com/member/signin.php", post={
"loginEmail": user,
- "loginPassword": data["password"],
+ "loginPassword": data['password'],
"Submit": "Sign In"})
if req.lastEffectiveURL != "http://www.filefactory.com/account/":
diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py
index 304f20040..72e275d4f 100644
--- a/module/plugins/accounts/FilejungleCom.py
+++ b/module/plugins/accounts/FilejungleCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from time import mktime, strptime
@@ -25,8 +8,9 @@ from module.plugins.Account import Account
class FilejungleCom(Account):
__name__ = "FilejungleCom"
- __version__ = "0.11"
__type__ = "account"
+ __version__ = "0.11"
+
__description__ = """Filejungle.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -37,12 +21,13 @@ class FilejungleCom(Account):
TRAFFIC_LEFT_PATTERN = r'"/extend_premium\.php">Until (\d+ [A-Za-z]+ \d+)<br'
LOGIN_FAILED_PATTERN = r'<span htmlfor="loginUser(Name|Password)" generated="true" class="fail_info">'
+
def loadAccountInfo(self, user, req):
html = req.load(self.URL + "dashboard.php")
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if found:
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ if m:
premium = True
- validuntil = mktime(strptime(found.group(1), "%d %b %Y"))
+ validuntil = mktime(strptime(m.group(1), "%d %b %Y"))
else:
premium = False
validuntil = -1
@@ -52,7 +37,7 @@ class FilejungleCom(Account):
def login(self, user, data, req):
html = req.load(self.URL + "login.php", post={
"loginUserName": user,
- "loginUserPassword": data["password"],
+ "loginUserPassword": data['password'],
"loginFormSubmit": "Login",
"recaptcha_challenge_field": "",
"recaptcha_response_field": "",
diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py
index 28ddf2e3f..2e50298d7 100644
--- a/module/plugins/accounts/FilerNet.py
+++ b/module/plugins/accounts/FilerNet.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
import time
@@ -23,8 +9,9 @@ from module.utils import parseFileSize
class FilerNet(Account):
__name__ = "FilerNet"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Filer.net account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
@@ -34,15 +21,16 @@ class FilerNet(Account):
TRAFFIC_PATTERN = r'Traffic</th>\s*<td>([^<]+)</td>'
FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free'
+
def loadAccountInfo(self, user, req):
- self.html = req.load("https://filer.net/profile")
+ html = req.load("https://filer.net/profile")
# Free user
- if re.search(self.FREE_PATTERN, self.html):
+ if re.search(self.FREE_PATTERN, html):
return {"premium": False, "validuntil": None, "trafficleft": None}
- until = re.search(self.WALID_UNTIL_PATTERN, self.html)
- traffic = re.search(self.TRAFFIC_PATTERN, self.html)
+ until = re.search(self.WALID_UNTIL_PATTERN, html)
+ traffic = re.search(self.TRAFFIC_PATTERN, html)
if until and traffic:
validuntil = int(time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S")))
trafficleft = parseFileSize(traffic.group(1)) / 1024
@@ -52,10 +40,10 @@ class FilerNet(Account):
return {"premium": False, "validuntil": None, "trafficleft": None}
def login(self, user, data, req):
- self.html = req.load("https://filer.net/login")
- token = re.search(self.TOKEN_PATTERN, self.html).group(1)
- self.html = req.load("https://filer.net/login_check",
- post={"_username": user, "_password": data["password"],
+ html = req.load("https://filer.net/login")
+ token = re.search(self.TOKEN_PATTERN, html).group(1)
+ html = req.load("https://filer.net/login_check",
+ post={"_username": user, "_password": data['password'],
"_remember_me": "on", "_csrf_token": token, "_target_path": "https://filer.net/"})
- if 'Logout' not in self.html:
+ if 'Logout' not in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/FilerioCom.py b/module/plugins/accounts/FilerioCom.py
index 5f2164cf1..544a7f3a6 100644
--- a/module/plugins/accounts/FilerioCom.py
+++ b/module/plugins/accounts/FilerioCom.py
@@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class FilerioCom(XFSPAccount):
__name__ = "FilerioCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """FileRio.in account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py
index 794e80d84..5ece67140 100644
--- a/module/plugins/accounts/FilesMailRu.py
+++ b/module/plugins/accounts/FilesMailRu.py
@@ -1,33 +1,18 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
-"""
-
from module.plugins.Account import Account
class FilesMailRu(Account):
__name__ = "FilesMailRu"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Filesmail.ru account plugin"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def loadAccountInfo(self, user, req):
return {"validuntil": None, "trafficleft": None}
diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py
index 266935a9f..5be5e8d04 100644
--- a/module/plugins/accounts/FileserveCom.py
+++ b/module/plugins/accounts/FileserveCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from time import mktime, strptime
from module.plugins.Account import Account
@@ -25,34 +8,36 @@ from module.common.json_layer import json_loads
class FileserveCom(Account):
__name__ = "FileserveCom"
- __version__ = "0.2"
__type__ = "account"
+ __version__ = "0.2"
+
__description__ = """Fileserve.com account plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data["password"],
+ page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'],
"submit": "Submit+Query"})
res = json_loads(page)
- if res["type"] == "premium":
- validuntil = mktime(strptime(res["expireTime"], "%Y-%m-%d %H:%M:%S"))
- return {"trafficleft": res["traffic"], "validuntil": validuntil}
+ if res['type'] == "premium":
+ validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S"))
+ return {"trafficleft": res['traffic'], "validuntil": validuntil}
else:
return {"premium": False, "trafficleft": None, "validuntil": None}
def login(self, user, data, req):
- page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data["password"],
+ page = req.load("http://app.fileserve.com/api/login/", post={"username": user, "password": data['password'],
"submit": "Submit+Query"})
res = json_loads(page)
- if not res["type"]:
+ if not res['type']:
self.wrongPassword()
#login at fileserv page
req.load("http://www.fileserve.com/login.php",
- post={"loginUserName": user, "loginUserPassword": data["password"], "autoLogin": "checked",
+ post={"loginUserName": user, "loginUserPassword": data['password'], "autoLogin": "checked",
"loginFormSubmit": "Login"})
diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py
index 869705313..206edca23 100644
--- a/module/plugins/accounts/FourSharedCom.py
+++ b/module/plugins/accounts/FourSharedCom.py
@@ -1,34 +1,19 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.Account import Account
from module.common.json_layer import json_loads
class FourSharedCom(Account):
__name__ = "FourSharedCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """FourShared.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def loadAccountInfo(self, user, req):
#fixme
return {"validuntil": -1, "trafficleft": -1, "premium": False}
diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py
index 6628db6b1..dfa5f4541 100644
--- a/module/plugins/accounts/FreakshareCom.py
+++ b/module/plugins/accounts/FreakshareCom.py
@@ -1,21 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
-"""
import re
from time import strptime, mktime
@@ -24,12 +8,14 @@ from module.plugins.Account import Account
class FreakshareCom(Account):
__name__ = "FreakshareCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Freakshare.com account plugin"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def loadAccountInfo(self, user, req):
page = req.load("http://freakshare.com/")
diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py
index 955cc3c7f..fe5a79949 100644
--- a/module/plugins/accounts/FreeWayMe.py
+++ b/module/plugins/accounts/FreeWayMe.py
@@ -1,34 +1,19 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Nicolas Giese
-"""
-
from module.plugins.Account import Account
from module.common.json_layer import json_loads
class FreeWayMe(Account):
__name__ = "FreeWayMe"
- __version__ = "0.11"
__type__ = "account"
+ __version__ = "0.11"
+
__description__ = """FreeWayMe account plugin"""
__author_name__ = "Nicolas Giese"
__author_mail__ = "james@free-way.me"
+
def loadAccountInfo(self, user, req):
status = self.getAccountStatus(user, req)
if not status:
@@ -36,19 +21,19 @@ class FreeWayMe(Account):
self.logDebug(status)
account_info = {"validuntil": -1, "premium": False}
- if status["premium"] == "Free":
- account_info["trafficleft"] = int(status["guthaben"]) * 1024
- elif status["premium"] == "Spender":
- account_info["trafficleft"] = -1
- elif status["premium"] == "Flatrate":
- account_info = {"validuntil": int(status["Flatrate"]),
+ if status['premium'] == "Free":
+ account_info['trafficleft'] = int(status['guthaben']) * 1024
+ elif status['premium'] == "Spender":
+ account_info['trafficleft'] = -1
+ elif status['premium'] == "Flatrate":
+ account_info = {"validuntil": int(status['Flatrate']),
"trafficleft": -1,
"premium": True}
return account_info
def getpw(self, user):
- return self.accounts[user]["password"]
+ return self.accounts[user]['password']
def login(self, user, data, req):
status = self.getAccountStatus(user, req)
@@ -59,7 +44,7 @@ class FreeWayMe(Account):
def getAccountStatus(self, user, req):
answer = req.load("https://www.free-way.me/ajax/jd.php",
- get={"id": 4, "user": user, "pass": self.accounts[user]["password"]})
+ get={"id": 4, "user": user, "pass": self.accounts[user]['password']})
self.logDebug("login: %s" % answer)
if answer == "Invalid login":
self.wrongPassword()
diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py
index 61122b996..78714f238 100644
--- a/module/plugins/accounts/FshareVn.py
+++ b/module/plugins/accounts/FshareVn.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from time import mktime, strptime
from pycurl import REFERER
import re
@@ -26,8 +9,9 @@ from module.plugins.Account import Account
class FshareVn(Account):
__name__ = "FshareVn"
- __version__ = "0.07"
__type__ = "account"
+ __version__ = "0.07"
+
__description__ = """Fshare.vn account plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
@@ -37,18 +21,19 @@ class FshareVn(Account):
TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd[^>]*>([0-9.]+) ([kKMG])B</dd>'
DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>'
+
def loadAccountInfo(self, user, req):
- self.html = req.load("http://www.fshare.vn/account_info.php", decode=True)
+ html = req.load("http://www.fshare.vn/account_info.php", decode=True)
- if re.search(self.LIFETIME_PATTERN, self.html):
+ if re.search(self.LIFETIME_PATTERN, html):
self.logDebug("Lifetime membership detected")
trafficleft = self.getTrafficLeft()
return {"validuntil": -1, "trafficleft": trafficleft, "premium": True}
- found = re.search(self.VALID_UNTIL_PATTERN, self.html)
- if found:
+ m = re.search(self.VALID_UNTIL_PATTERN, html)
+ if m:
premium = True
- validuntil = mktime(strptime(found.group(1), '%I:%M:%S %p %d-%m-%Y'))
+ validuntil = mktime(strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y'))
trafficleft = self.getTrafficLeft()
else:
premium = False
@@ -60,15 +45,15 @@ class FshareVn(Account):
def login(self, user, data, req):
req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php")
- self.html = req.load('https://www.fshare.vn/login.php', post={
+ html = req.load('https://www.fshare.vn/login.php', post={
"login_password": data['password'],
"login_useremail": user,
"url_refe": "http://www.fshare.vn/index.php"
}, referer=True, decode=True)
- if not re.search(r'<img\s+alt="VIP"', self.html):
+ if not re.search(r'<img\s+alt="VIP"', html):
self.wrongPassword()
def getTrafficLeft(self):
- found = re.search(self.TRAFFIC_LEFT_PATTERN, self.html)
- return float(found.group(1)) * 1024 ** {'k': 0, 'K': 0, 'M': 1, 'G': 2}[found.group(2)] if found else 0
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ return float(m.group(1)) * 1024 ** {'k': 0, 'K': 0, 'M': 1, 'G': 2}[m.group(2)] if m else 0
diff --git a/module/plugins/accounts/Ftp.py b/module/plugins/accounts/Ftp.py
index 18e25c716..1319ea2a7 100644
--- a/module/plugins/accounts/Ftp.py
+++ b/module/plugins/accounts/Ftp.py
@@ -5,10 +5,12 @@ from module.plugins.Account import Account
class Ftp(Account):
__name__ = "Ftp"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Ftp dummy account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
login_timeout = info_threshold = -1 #: Unlimited
diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py
index b6c738715..9207cddab 100644
--- a/module/plugins/accounts/HellshareCz.py
+++ b/module/plugins/accounts/HellshareCz.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
import time
@@ -25,25 +8,27 @@ from module.plugins.Account import Account
class HellshareCz(Account):
__name__ = "HellshareCz"
- __version__ = "0.14"
__type__ = "account"
+ __version__ = "0.14"
+
__description__ = """Hellshare.cz account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
CREDIT_LEFT_PATTERN = r'<div class="credit-link">\s*<table>\s*<tr>\s*<th>(\d+|\d\d\.\d\d\.)</th>'
+
def loadAccountInfo(self, user, req):
self.relogin(user)
html = req.load("http://www.hellshare.com/")
- found = re.search(self.CREDIT_LEFT_PATTERN, html)
- if found is None:
+ m = re.search(self.CREDIT_LEFT_PATTERN, html)
+ if m is None:
trafficleft = None
validuntil = None
premium = False
else:
- credit = found.group(1)
+ credit = m.group(1)
premium = True
try:
if "." in credit:
@@ -80,7 +65,7 @@ class HellshareCz(Account):
html = req.load('http://www.hellshare.com/login?do=loginForm-submit', post={
"login": "Log in",
- "password": data["password"],
+ "password": data['password'],
"username": user,
"perm_login": "on"
})
diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py
index f6988542f..cffbbab8f 100644
--- a/module/plugins/accounts/HotfileCom.py
+++ b/module/plugins/accounts/HotfileCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, JoKoT3
-"""
-
from time import strptime, mktime
import hashlib
@@ -25,12 +8,14 @@ from module.plugins.Account import Account
class HotfileCom(Account):
__name__ = "HotfileCom"
- __version__ = "0.2"
__type__ = "account"
+ __version__ = "0.2"
+
__description__ = """Hotfile.com account plugin"""
__author_name__ = ("mkaay", "JoKoT3")
__author_mail__ = ("mkaay@mkaay.de", "jokot3@gmail.com")
+
def loadAccountInfo(self, user, req):
resp = self.apiCall("getuserinfo", user=user)
if resp.startswith("."):
@@ -42,12 +27,12 @@ class HotfileCom(Account):
info[key] = value
if info['is_premium'] == '1':
- info["premium_until"] = info["premium_until"].replace("T", " ")
- zone = info["premium_until"][19:]
- info["premium_until"] = info["premium_until"][:19]
+ info['premium_until'] = info['premium_until'].replace("T", " ")
+ zone = info['premium_until'][19:]
+ info['premium_until'] = info['premium_until'][:19]
zone = int(zone[:3])
- validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60)
+ validuntil = int(mktime(strptime(info['premium_until'], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60)
tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": True}
elif info['is_premium'] == '0':
@@ -65,7 +50,7 @@ class HotfileCom(Account):
digest = req.load("http://api.hotfile.com/", post={"action": "getdigest"})
h = hashlib.md5()
- h.update(data["password"])
+ h.update(data['password'])
hp = h.hexdigest()
h = hashlib.md5()
h.update(hp)
@@ -82,7 +67,7 @@ class HotfileCom(Account):
cj = self.getAccountCookies(user)
cj.setCookie("hotfile.com", "lang", "en")
req.load("http://hotfile.com/", cookies=True)
- page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data["password"]},
+ page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data['password']},
cookies=True)
if "Bad username/password" in page:
diff --git a/module/plugins/accounts/Http.py b/module/plugins/accounts/Http.py
index 932b0aa64..589a45617 100644
--- a/module/plugins/accounts/Http.py
+++ b/module/plugins/accounts/Http.py
@@ -5,10 +5,12 @@ from module.plugins.Account import Account
class Http(Account):
__name__ = "Http"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Http dummy account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
login_timeout = info_threshold = -1 #: Unlimited
diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py
index e37c860a6..c849f9d2d 100644
--- a/module/plugins/accounts/LetitbitNet.py
+++ b/module/plugins/accounts/LetitbitNet.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.Account import Account
# from module.common.json_layer import json_loads, json_dumps
@@ -20,16 +6,18 @@ from module.plugins.Account import Account
class LetitbitNet(Account):
__name__ = "LetitbitNet"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Letitbit.net account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def loadAccountInfo(self, user, req):
## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ##
# api_key = self.accounts[user]['password']
- # json_data = [api_key, ["key/info"]]
+ # json_data = [api_key, ['key/info']]
# api_rep = req.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)})
# self.logDebug('API Key Info: ' + api_rep)
# api_rep = json_loads(api_rep)
diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py
index 63b9576d6..a03357e25 100644
--- a/module/plugins/accounts/LinksnappyCom.py
+++ b/module/plugins/accounts/LinksnappyCom.py
@@ -8,12 +8,14 @@ from module.common.json_layer import json_loads
class LinksnappyCom(Account):
__name__ = "LinksnappyCom"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """Linksnappy.com account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
r = req.load('http://gen.linksnappy.com/lseAPI.php',
diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py
index 1fbe00ff7..9c5603989 100644
--- a/module/plugins/accounts/MegaDebridEu.py
+++ b/module/plugins/accounts/MegaDebridEu.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.Account import Account
from module.common.json_layer import json_loads
@@ -20,8 +6,9 @@ from module.common.json_layer import json_loads
class MegaDebridEu(Account):
__name__ = "MegaDebridEu"
- __version__ = "0.2"
__type__ = "account"
+ __version__ = "0.2"
+
__description__ = """mega-debrid.eu account plugin"""
__author_name__ = "D.Ducatel"
__author_mail__ = "dducatel@je-geek.fr"
@@ -29,21 +16,22 @@ class MegaDebridEu(Account):
# Define the base URL of MegaDebrid api
API_URL = "https://www.mega-debrid.eu/api.php"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
jsonResponse = req.load(self.API_URL,
- get={'action': 'connectUser', 'login': user, 'password': data["password"]})
+ get={'action': 'connectUser', 'login': user, 'password': data['password']})
response = json_loads(jsonResponse)
- if response["response_code"] == "ok":
- return {"premium": True, "validuntil": float(response["vip_end"]), "status": True}
+ if response['response_code'] == "ok":
+ return {"premium": True, "validuntil": float(response['vip_end']), "status": True}
else:
self.logError(response)
return {"status": False, "premium": False}
def login(self, user, data, req):
jsonResponse = req.load(self.API_URL,
- get={'action': 'connectUser', 'login': user, 'password': data["password"]})
+ get={'action': 'connectUser', 'login': user, 'password': data['password']})
response = json_loads(jsonResponse)
- if response["response_code"] != "ok":
+ if response['response_code'] != "ok":
self.wrongPassword()
diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py
index 59aefe374..7c4777706 100644
--- a/module/plugins/accounts/MegasharesCom.py
+++ b/module/plugins/accounts/MegasharesCom.py
@@ -8,14 +8,16 @@ from module.plugins.Account import Account
class MegasharesCom(Account):
__name__ = "MegasharesCom"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """Megashares.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
VALID_UNTIL_PATTERN = r'<p class="premium_info_box">Period Ends: (\w{3} \d{1,2}, \d{4})</p>'
+
def loadAccountInfo(self, user, req):
#self.relogin(user)
html = req.load("http://d01.megashares.com/myms.php", decode=True)
diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py
index 2225261f0..34862c4ef 100644
--- a/module/plugins/accounts/MovReelCom.py
+++ b/module/plugins/accounts/MovReelCom.py
@@ -5,14 +5,15 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class MovReelCom(XFSPAccount):
__name__ = "MovReelCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Movreel.com account plugin"""
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
- login_timeout = 60 #: after that time [in minutes] pyload will relogin the account
- info_threshold = 30 #: account data will be reloaded after this time
+ login_timeout = 60
+ info_threshold = 30
MAIN_PAGE = "http://movreel.com/"
diff --git a/module/plugins/accounts/MultiDebridCom.py b/module/plugins/accounts/MultiDebridCom.py
index 704b4ac78..c731ce9ae 100644
--- a/module/plugins/accounts/MultiDebridCom.py
+++ b/module/plugins/accounts/MultiDebridCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from time import time
@@ -22,12 +8,14 @@ from module.common.json_layer import json_loads
class MultiDebridCom(Account):
__name__ = "MultiDebridCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Multi-debrid.com account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def loadAccountInfo(self, user, req):
if 'days_left' in self.json_data:
validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60)
@@ -37,10 +25,10 @@ class MultiDebridCom(Account):
def login(self, user, data, req):
# Password to use is the API-Password written in http://multi-debrid.com/myaccount
- self.html = req.load("http://multi-debrid.com/api.php",
- get={"user": user, "pass": data["password"]})
- self.logDebug('JSON data: ' + self.html)
- self.json_data = json_loads(self.html)
+ html = req.load("http://multi-debrid.com/api.php",
+ get={"user": user, "pass": data['password']})
+ self.logDebug('JSON data: ' + html)
+ self.json_data = json_loads(html)
if self.json_data['status'] != 'ok':
self.logError('Invalid login. The password to use is the API-Password you find in your "My Account" page')
self.wrongPassword()
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py
index cd2fd575c..fc13bac69 100644
--- a/module/plugins/accounts/MultishareCz.py
+++ b/module/plugins/accounts/MultishareCz.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.Account import Account
#from time import mktime, strptime
#from pycurl import REFERER
@@ -26,8 +9,9 @@ from module.utils import parseFileSize
class MultishareCz(Account):
__name__ = "MultishareCz"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """Multishare.cz account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -35,12 +19,13 @@ class MultishareCz(Account):
TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[0-9,]+)&nbsp;(?P<U>\w+)</strong>'
ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">'
+
def loadAccountInfo(self, user, req):
#self.relogin(user)
html = req.load("http://www.multishare.cz/profil/", decode=True)
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- trafficleft = parseFileSize(found.group('S'), found.group('U')) / 1024 if found else 0
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ trafficleft = parseFileSize(m.group('S'), m.group('U')) / 1024 if m else 0
self.premium = True if trafficleft else False
html = req.load("http://www.multishare.cz/", decode=True)
diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py
index 3d2b52470..12c5556fb 100755
--- a/module/plugins/accounts/NetloadIn.py
+++ b/module/plugins/accounts/NetloadIn.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
import re
from time import time
@@ -25,12 +8,14 @@ from module.plugins.Account import Account
class NetloadIn(Account):
__name__ = "NetloadIn"
- __version__ = "0.22"
__type__ = "account"
+ __version__ = "0.22"
+
__description__ = """Netload.in account plugin"""
__author_name__ = ("RaNaN", "CryNickSystems")
__author_mail__ = ("RaNaN@pyload.org", "webmaster@pcProfil.de")
+
def loadAccountInfo(self, user, req):
page = req.load("http://netload.in/index.php?id=2&lang=de")
left = r">(\d+) (Tag|Tage), (\d+) Stunden<"
diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py
index 19fcea67a..a37759f9a 100644
--- a/module/plugins/accounts/OboomCom.py
+++ b/module/plugins/accounts/OboomCom.py
@@ -2,21 +2,24 @@
import time
-from module.plugins.Account import Account
from module.lib.beaker.crypto.pbkdf2 import PBKDF2
+
from module.common.json_layer import json_loads
+from module.plugins.Account import Account
class OboomCom(Account):
__name__ = "OboomCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Oboom.com account plugin"""
__author_name__ = "stanley"
__author_mail__ = "stanley.foerster@gmail.com"
+
def loadAccountData(self, user, req):
- passwd = self.getAccountData(user)["password"]
+ passwd = self.getAccountData(user)['password']
salt = passwd[::-1]
pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16)
result = json_loads(req.load("https://www.oboom.com/1.0/login", get={"auth": user, "pass": pbkdf2}))
@@ -27,17 +30,17 @@ class OboomCom(Account):
def loadAccountInfo(self, name, req):
accountData = self.loadAccountData(name, req)
- userData = accountData["user"]
+ userData = accountData['user']
if "premium_unix" in userData:
- validUntilUtc = int(userData["premium_unix"])
+ validUntilUtc = int(userData['premium_unix'])
if validUntilUtc > int(time.time()):
premium = True
validUntil = validUntilUtc
- traffic = userData["traffic"]
- trafficLeft = traffic["current"]
- maxTraffic = traffic["max"]
- session = accountData["session"]
+ traffic = userData['traffic']
+ trafficLeft = traffic['current']
+ maxTraffic = traffic['max']
+ session = accountData['session']
return {"premium": premium,
"validuntil": validUntil,
"trafficleft": trafficLeft / 1024,
diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py
index b10e34314..43dd1c2b6 100644
--- a/module/plugins/accounts/OneFichierCom.py
+++ b/module/plugins/accounts/OneFichierCom.py
@@ -9,14 +9,16 @@ from module.plugins.Account import Account
class OneFichierCom(Account):
__name__ = "OneFichierCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """1fichier.com account plugin"""
- __author_name__ = ("Elrick69")
- __author_mail__ = ("elrick69[AT]rocketmail[DOT]com")
+ __author_name__ = "Elrick69"
+ __author_mail__ = "elrick69[AT]rocketmail[DOT]com"
VALID_UNTIL_PATTERN = r'You are a premium user until (?P<d>\d{2})/(?P<m>\d{2})/(?P<y>\d{4})'
+
def loadAccountInfo(self, user, req):
html = req.load("http://1fichier.com/console/abo.pl")
@@ -39,7 +41,7 @@ class OneFichierCom(Account):
html = req.load("http://1fichier.com/login.pl?lg=en", post={
"mail": user,
- "pass": data["password"],
+ "pass": data['password'],
"Login": "Login"})
if r'<div class="error_message">Invalid username or password.</div>' in html:
diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py
index eab20480f..34f684cb1 100644
--- a/module/plugins/accounts/OverLoadMe.py
+++ b/module/plugins/accounts/OverLoadMe.py
@@ -6,28 +6,30 @@ from module.common.json_layer import json_loads
class OverLoadMe(Account):
__name__ = "OverLoadMe"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Over-Load.me account plugin"""
__author_name__ = "marley"
__author_mail__ = "marley@over-load.me"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data["password"]}).strip()
+ page = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip()
data = json_loads(page)
# Check for premium
- if data["membership"] == "Free":
+ if data['membership'] == "Free":
return {"premium": False}
- account_info = {"validuntil": data["expirationunix"], "trafficleft": -1}
+ account_info = {"validuntil": data['expirationunix'], "trafficleft": -1}
return account_info
def login(self, user, data, req):
jsondata = req.load("https://api.over-load.me/account.php",
- get={"user": user, "auth": data["password"]}).strip()
+ get={"user": user, "auth": data['password']}).strip()
data = json_loads(jsondata)
- if data["err"] == 1:
+ if data['err'] == 1:
self.wrongPassword()
diff --git a/module/plugins/accounts/Premium4Me.py b/module/plugins/accounts/Premium4Me.py
index c80f40f5c..9f66af414 100644
--- a/module/plugins/accounts/Premium4Me.py
+++ b/module/plugins/accounts/Premium4Me.py
@@ -5,12 +5,14 @@ from module.plugins.Account import Account
class Premium4Me(Account):
__name__ = "Premium4Me"
- __version__ = "0.03"
__type__ = "account"
+ __version__ = "0.03"
+
__description__ = """Premium.to account plugin"""
__author_name__ = ("RaNaN", "zoidberg", "stickell")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
def loadAccountInfo(self, user, req):
traffic = req.load("http://premium.to/api/traffic.php?authcode=%s" % self.authcode)
@@ -21,7 +23,7 @@ class Premium4Me(Account):
def login(self, user, data, req):
self.authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (
- user, data["password"])).strip()
+ user, data['password'])).strip()
if "wrong username" in self.authcode:
self.wrongPassword()
diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py
index 1da5d9002..dcf8b8f20 100644
--- a/module/plugins/accounts/PremiumizeMe.py
+++ b/module/plugins/accounts/PremiumizeMe.py
@@ -7,12 +7,14 @@ from module.common.json_layer import json_loads
class PremiumizeMe(Account):
__name__ = "PremiumizeMe"
- __version__ = "0.11"
__type__ = "account"
+ __version__ = "0.11"
+
__description__ = """Premiumize.me account plugin"""
__author_name__ = "Florian Franzen"
__author_mail__ = "FlorianFranzen@gmail.com"
+
def loadAccountInfo(self, user, req):
# Get user data from premiumize.me
status = self.getAccountStatus(user, req)
diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py
index 5a69a7f66..fcaf14e92 100644
--- a/module/plugins/accounts/QuickshareCz.py
+++ b/module/plugins/accounts/QuickshareCz.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Account import Account
from module.utils import parseFileSize
@@ -24,18 +7,20 @@ from module.utils import parseFileSize
class QuickshareCz(Account):
__name__ = "QuickshareCz"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """Quickshare.cz account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def loadAccountInfo(self, user, req):
html = req.load("http://www.quickshare.cz/premium", decode=True)
- found = re.search(r'Stav kreditu: <strong>(.+?)</strong>', html)
- if found:
- trafficleft = parseFileSize(found.group(1)) / 1024
+ m = re.search(r'Stav kreditu: <strong>(.+?)</strong>', html)
+ if m:
+ trafficleft = parseFileSize(m.group(1)) / 1024
premium = True if trafficleft else False
else:
trafficleft = None
diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py
index 49a294d14..358f6ffca 100644
--- a/module/plugins/accounts/RPNetBiz.py
+++ b/module/plugins/accounts/RPNetBiz.py
@@ -6,12 +6,14 @@ from module.common.json_layer import json_loads
class RPNetBiz(Account):
__name__ = "RPNetBiz"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """RPNet.biz account plugin"""
__author_name__ = "Dman"
__author_mail__ = "dmanugm@gmail.com"
+
def loadAccountInfo(self, user, req):
# Get account information from rpnet.biz
response = self.getAccountStatus(user, req)
diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py
index c008a0db3..849933a87 100644
--- a/module/plugins/accounts/RapidgatorNet.py
+++ b/module/plugins/accounts/RapidgatorNet.py
@@ -1,36 +1,21 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.Account import Account
from module.common.json_layer import json_loads
class RapidgatorNet(Account):
__name__ = "RapidgatorNet"
- __version__ = "0.04"
__type__ = "account"
+ __version__ = "0.04"
+
__description__ = """Rapidgator.net account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
API_URL = 'http://rapidgator.net/api/user'
+
def loadAccountInfo(self, user, req):
try:
sid = self.getAccountData(user).get('SID')
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py
index 17d7f0e08..dc4f09ee1 100644
--- a/module/plugins/accounts/RapidshareCom.py
+++ b/module/plugins/accounts/RapidshareCom.py
@@ -1,38 +1,23 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from module.plugins.Account import Account
class RapidshareCom(Account):
__name__ = "RapidshareCom"
- __version__ = "0.22"
__type__ = "account"
+ __version__ = "0.22"
+
__description__ = """Rapidshare.com account plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user,
- "password": data["password"], "withcookie": 1}
+ "password": data['password'], "withcookie": 1}
src = req.load(api_url_base, cookies=False, get=api_param_prem)
if src.startswith("ERROR"):
raise Exception(src)
@@ -44,7 +29,7 @@ class RapidshareCom(Account):
k, v = t.split("=")
info[k] = v
- validuntil = int(info["billeduntil"])
+ validuntil = int(info['billeduntil'])
premium = True if validuntil else False
tmp = {"premium": premium, "validuntil": validuntil, "trafficleft": -1, "maxtraffic": -1}
@@ -54,7 +39,7 @@ class RapidshareCom(Account):
def login(self, user, data, req):
api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user,
- "password": data["password"], "withcookie": 1}
+ "password": data['password'], "withcookie": 1}
src = req.load(api_url_base, cookies=False, get=api_param_prem)
if src.startswith("ERROR"):
raise Exception(src + "### Note you have to use your account number for login, instead of name.")
@@ -66,4 +51,4 @@ class RapidshareCom(Account):
k, v = t.split("=")
info[k] = v
cj = self.getAccountCookies(user)
- cj.setCookie("rapidshare.com", "enc", info["cookie"])
+ cj.setCookie("rapidshare.com", "enc", info['cookie'])
diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py
index 494941aef..c8eae79a8 100644
--- a/module/plugins/accounts/RarefileNet.py
+++ b/module/plugins/accounts/RarefileNet.py
@@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class RarefileNet(XFSPAccount):
__name__ = "RarefileNet"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """RareFile.net account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py
index 86ad18085..9d1939c60 100644
--- a/module/plugins/accounts/RealdebridCom.py
+++ b/module/plugins/accounts/RealdebridCom.py
@@ -7,12 +7,14 @@ from module.plugins.Account import Account
class RealdebridCom(Account):
__name__ = "RealdebridCom"
- __version__ = "0.43"
__type__ = "account"
+ __version__ = "0.43"
+
__description__ = """Real-Debrid.com account plugin"""
__author_name__ = "Devirex Hazzard"
__author_mail__ = "naibaf_11@yahoo.de"
+
def loadAccountInfo(self, user, req):
if self.pin_code:
return {"premium": False}
@@ -25,7 +27,7 @@ class RealdebridCom(Account):
def login(self, user, data, req):
self.pin_code = False
- page = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data["password"]})
+ page = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']})
if "Your login informations are incorrect" in page:
self.wrongPassword()
elif "PIN Code required" in page:
diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py
index c4aa85484..f15230f83 100644
--- a/module/plugins/accounts/RehostTo.py
+++ b/module/plugins/accounts/RehostTo.py
@@ -5,15 +5,17 @@ from module.plugins.Account import Account
class RehostTo(Account):
__name__ = "RehostTo"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Rehost.to account plugin"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data["password"]))
+ page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password']))
data = [x.split("=") for x in page.split(",")]
ses = data[0][1]
long_ses = data[1][1]
@@ -29,7 +31,7 @@ class RehostTo(Account):
return account_info
def login(self, user, data, req):
- page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data["password"]))
+ page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password']))
if "Login failed." in page:
self.wrongPassword()
diff --git a/module/plugins/accounts/ReloadCc.py b/module/plugins/accounts/ReloadCc.py
deleted file mode 100644
index af23d9936..000000000
--- a/module/plugins/accounts/ReloadCc.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.Account import Account
-
-from module.common.json_layer import json_loads
-
-from module.network.HTTPRequest import BadHeader
-
-
-class ReloadCc(Account):
- __name__ = "ReloadCc"
- __version__ = "0.3"
- __type__ = "account"
- __description__ = """Reload.cc account plugin"""
-
- __author_name__ = "Reload Team"
- __author_mail__ = "hello@reload.cc"
-
- def loadAccountInfo(self, user, req):
-
- # Get user data from reload.cc
- status = self.getAccountStatus(user, req)
-
- # Parse account info
- account_info = {"validuntil": float(status['msg']['expires']),
- "pwdhash": status['msg']['hash'],
- "trafficleft": -1}
-
- return account_info
-
- def login(self, user, data, req):
-
- # Get user data from reload.cc
- status = self.getAccountStatus(user, req)
-
- if not status:
- raise Exception("There was an error upon logging in to Reload.cc!")
-
- # Check if user and password are valid
- if status['status'] != "ok":
- self.wrongPassword()
-
- def getAccountStatus(self, user, req):
- # Use reload.cc API v1 to retrieve account info and return the parsed json answer
- query_params = dict(
- via='pyload',
- v=1,
- get_traffic='true',
- user=user
- )
-
- try:
- query_params.update(dict(hash=self.infos[user]['pwdhash']))
- except Exception:
- query_params.update(dict(pwd=self.accounts[user]['password']))
-
- try:
- answer = req.load("http://api.reload.cc/login", get=query_params)
- except BadHeader, e:
- if e.code == 400:
- raise Exception("There was an unknown error within the Reload.cc plugin.")
- elif e.code == 401:
- self.wrongPassword()
- elif e.code == 402:
- self.expired(user)
- elif e.code == 403:
- raise Exception("Your account is disabled. Please contact the Reload.cc support!")
- elif e.code == 409:
- self.empty(user)
- elif e.code == 503:
- self.logInfo("Reload.cc is currently in maintenance mode! Please check again later.")
- self.wrongPassword()
- return None
-
- return json_loads(answer)
diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py
index 6a15c4c82..7fb373ca7 100644
--- a/module/plugins/accounts/RyushareCom.py
+++ b/module/plugins/accounts/RyushareCom.py
@@ -5,17 +5,19 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class RyushareCom(XFSPAccount):
__name__ = "RyushareCom"
- __version__ = "0.03"
__type__ = "account"
+ __version__ = "0.03"
+
__description__ = """Ryushare.com account plugin"""
__author_name__ = ("zoidberg", "trance4us")
__author_mail__ = ("zoidberg@mujmail.cz", "")
MAIN_PAGE = "http://ryushare.com/"
+
def login(self, user, data, req):
req.lastURL = "http://ryushare.com/login.python"
html = req.load("http://ryushare.com/login.python",
- post={"login": user, "password": data["password"], "op": "login"})
+ post={"login": user, "password": data['password'], "op": "login"})
if 'Incorrect Login or Password' in html or '>Error<' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py
index 38150e5cf..50077b1fb 100644
--- a/module/plugins/accounts/ShareRapidCom.py
+++ b/module/plugins/accounts/ShareRapidCom.py
@@ -1,49 +1,52 @@
# -*- coding: utf-8 -*-
import re
+
from time import mktime, strptime
from module.plugins.Account import Account
class ShareRapidCom(Account):
__name__ = "ShareRapidCom"
- __version__ = "0.33"
__type__ = "account"
- __description__ = """ShareRapid account plugin"""
+ __version__ = "0.34"
+
+ __description__ = """MegaRapid.cz account plugin"""
__author_name__ = ("MikyWoW", "zoidberg")
__author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz")
login_timeout = 60
+
def loadAccountInfo(self, user, req):
- src = req.load("http://sharerapid.cz/mujucet/", decode=True)
+ src = req.load("http://megarapid.cz/mujucet/", decode=True)
- found = re.search(ur'<td>Max. počet paralelních stahování: </td><td>(\d+)', src)
- if found:
+ m = re.search(ur'<td>Max. počet paralelních stahování: </td><td>(\d+)', src)
+ if m:
data = self.getAccountData(user)
- data["options"]["limitDL"] = [int(found.group(1))]
+ data['options']['limitDL'] = [int(m.group(1))]
- found = re.search(ur'<td>Paušální stahování aktivní. Vyprší </td><td><strong>(.*?)</strong>', src)
- if found:
- validuntil = mktime(strptime(found.group(1), "%d.%m.%Y - %H:%M"))
+ m = re.search(ur'<td>Paušální stahování aktivní. Vyprší </td><td><strong>(.*?)</strong>', src)
+ if m:
+ validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M"))
return {"premium": True, "trafficleft": -1, "validuntil": validuntil}
- found = re.search(r'<tr><td>Kredit</td><td>(.*?) GiB', src)
- if found:
- trafficleft = float(found.group(1)) * (1 << 20)
+ m = re.search(r'<tr><td>Kredit</td><td>(.*?) GiB', src)
+ if m:
+ trafficleft = float(m.group(1)) * (1 << 20)
return {"premium": True, "trafficleft": trafficleft, "validuntil": -1}
return {"premium": False, "trafficleft": None, "validuntil": None}
def login(self, user, data, req):
- htm = req.load("http://sharerapid.cz/prihlaseni/", cookies=True)
+ htm = req.load("http://megarapid.cz/prihlaseni/", cookies=True)
if "Heslo:" in htm:
start = htm.index('id="inp_hash" name="hash" value="')
htm = htm[start + 33:]
hashes = htm[0:32]
- htm = req.load("http://sharerapid.cz/prihlaseni/",
+ htm = req.load("http://megarapid.cz/prihlaseni/",
post={"hash": hashes,
"login": user,
- "pass1": data["password"],
+ "pass1": data['password'],
"remember": 0,
"sbmt": u"Přihlásit"}, cookies=True)
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index f188fc580..b9ff0096c 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -1,36 +1,21 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from module.plugins.Account import Account
class ShareonlineBiz(Account):
__name__ = "ShareonlineBiz"
- __version__ = "0.24"
__type__ = "account"
+ __version__ = "0.24"
+
__description__ = """Share-online.biz account plugin"""
__author_name__ = ("mkaay", "zoidberg")
__author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz")
+
def getUserAPI(self, user, req):
return req.load("http://api.share-online.biz/account.php",
- {"username": user, "password": self.accounts[user]["password"], "act": "userDetails"})
+ {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"})
def loadAccountInfo(self, user, req):
src = self.getUserAPI(user, req)
@@ -42,14 +27,14 @@ class ShareonlineBiz(Account):
info[key] = value
self.logDebug(info)
- if "dl" in info and info["dl"].lower() != "not_available":
- req.cj.setCookie("share-online.biz", "dl", info["dl"])
- if "a" in info and info["a"].lower() != "not_available":
- req.cj.setCookie("share-online.biz", "a", info["a"])
+ if "dl" in info and info['dl'].lower() != "not_available":
+ req.cj.setCookie("share-online.biz", "dl", info['dl'])
+ if "a" in info and info['a'].lower() != "not_available":
+ req.cj.setCookie("share-online.biz", "a", info['a'])
- return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1,
+ return {"validuntil": int(info['expire_date']) if "expire_date" in info else -1,
"trafficleft": -1,
- "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False}
+ "premium": True if ("dl" in info or "a" in info) and (info['group'] != "Sammler") else False}
def login(self, user, data, req):
src = self.getUserAPI(user, req)
diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py
index 1e6d66806..b0a62f83b 100644
--- a/module/plugins/accounts/SimplyPremiumCom.py
+++ b/module/plugins/accounts/SimplyPremiumCom.py
@@ -1,31 +1,18 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-from module.plugins.Account import Account
from module.common.json_layer import json_loads
+from module.plugins.Account import Account
class SimplyPremiumCom(Account):
__name__ = "SimplyPremiumCom"
- __version__ = "0.01"
__type__ = "account"
- __description__ = """Simply-Premium.Com account plugin"""
- __author_name__ = ("EvolutionClip")
- __author_mail__ = ("evolutionclip@live.de")
+ __version__ = "0.01"
+
+ __description__ = """Simply-Premium.com account plugin"""
+ __author_name__ = "EvolutionClip"
+ __author_mail__ = "evolutionclip@live.de"
+
def loadAccountInfo(self, user, req):
json_data = req.load('http://www.simply-premium.com/api/user.php?format=json')
@@ -50,9 +37,9 @@ class SimplyPremiumCom(Account):
if data['password'] == '' or data['password'] == '0':
post_data = {"key": user}
else:
- post_data = {"login_name": user, "login_pass": data["password"]}
+ post_data = {"login_name": user, "login_pass": data['password']}
- self.html = req.load("http://www.simply-premium.com/login.php", post=post_data)
+ html = req.load("http://www.simply-premium.com/login.php", post=post_data)
- if 'logout' not in self.html:
+ if 'logout' not in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py
index c07702105..70f2d39b9 100644
--- a/module/plugins/accounts/SimplydebridCom.py
+++ b/module/plugins/accounts/SimplydebridCom.py
@@ -7,12 +7,14 @@ from module.plugins.Account import Account
class SimplydebridCom(Account):
__name__ = "SimplydebridCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Simply-Debrid.com account plugin"""
__author_name__ = "Kagenoshin"
__author_mail__ = "kagenoshin@gmx.ch"
+
def loadAccountInfo(self, user, req):
get_data = {'login': 2, 'u': self.loginname, 'p': self.password}
response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True)
@@ -24,7 +26,7 @@ class SimplydebridCom(Account):
def login(self, user, data, req):
self.loginname = user
- self.password = data["password"]
+ self.password = data['password']
get_data = {'login': 1, 'u': self.loginname, 'p': self.password}
response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True)
if response != "02: loggin success":
diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py
index 529e2131f..6d9c3e924 100644
--- a/module/plugins/accounts/StahnuTo.py
+++ b/module/plugins/accounts/StahnuTo.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Account import Account
@@ -25,26 +8,26 @@ from module.utils import parseFileSize
class StahnuTo(Account):
__name__ = "StahnuTo"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """StahnuTo account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- #login_timeout = 60
def loadAccountInfo(self, user, req):
html = req.load("http://www.stahnu.to/")
- found = re.search(r'>VIP: (\d+.*)<', html)
- trafficleft = parseFileSize(found.group(1)) * 1024 if found else 0
+ m = re.search(r'>VIP: (\d+.*)<', html)
+ trafficleft = parseFileSize(m.group(1)) * 1024 if m else 0
return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1}
def login(self, user, data, req):
html = req.load("http://www.stahnu.to/login.php", post={
"username": user,
- "password": data["password"],
+ "password": data['password'],
"submit": "Login"})
if not '<a href="logout.php">' in html:
diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py
index 19ffaf1e5..a477b06c0 100644
--- a/module/plugins/accounts/TurbobitNet.py
+++ b/module/plugins/accounts/TurbobitNet.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from time import mktime, strptime
@@ -25,21 +8,21 @@ from module.plugins.Account import Account
class TurbobitNet(Account):
__name__ = "TurbobitNet"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """TurbobitNet account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- #login_timeout = 60
def loadAccountInfo(self, user, req):
html = req.load("http://turbobit.net")
- found = re.search(r'<u>Turbo Access</u> to ([0-9.]+)', html)
- if found:
+ m = re.search(r'<u>Turbo Access</u> to ([0-9.]+)', html)
+ if m:
premium = True
- validuntil = mktime(strptime(found.group(1), "%d.%m.%Y"))
+ validuntil = mktime(strptime(m.group(1), "%d.%m.%Y"))
else:
premium = False
validuntil = -1
@@ -51,7 +34,7 @@ class TurbobitNet(Account):
html = req.load("http://turbobit.net/user/login", post={
"user[login]": user,
- "user[pass]": data["password"],
+ "user[pass]": data['password'],
"user[submit]": "Login"})
if not '<div class="menu-item user-name">' in html:
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py
index 6b1067f28..6f0d0ae7d 100644
--- a/module/plugins/accounts/UlozTo.py
+++ b/module/plugins/accounts/UlozTo.py
@@ -7,22 +7,24 @@ from module.plugins.Account import Account
class UlozTo(Account):
__name__ = "UlozTo"
- __version__ = "0.06"
__type__ = "account"
+ __version__ = "0.06"
+
__description__ = """Uloz.to account plugin"""
__author_name__ = ("zoidberg", "pulpe")
__author_mail__ = "zoidberg@mujmail.cz"
TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([0-9.]+) MB"'
+
def loadAccountInfo(self, user, req):
#this cookie gets lost somehow after each request
self.phpsessid = req.cj.getCookie("ULOSESSID")
html = req.load("http://www.ulozto.net/", decode=True)
req.cj.setCookie("www.ulozto.net", "ULOSESSID", self.phpsessid)
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- trafficleft = int(float(found.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if found else 0
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ trafficleft = int(float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if m else 0
self.premium = True if trafficleft else False
return {"validuntil": -1, "trafficleft": trafficleft}
diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py
index 2b647a49c..a65f19c5b 100644
--- a/module/plugins/accounts/UnrestrictLi.py
+++ b/module/plugins/accounts/UnrestrictLi.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.Account import Account
from module.common.json_layer import json_loads
@@ -20,12 +6,14 @@ from module.common.json_layer import json_loads
class UnrestrictLi(Account):
__name__ = "UnrestrictLi"
- __version__ = "0.03"
__type__ = "account"
+ __version__ = "0.03"
+
__description__ = """Unrestrict.li account plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def loadAccountInfo(self, user, req):
json_data = req.load('http://unrestrict.li/api/jdownloader/user.php?format=json')
self.logDebug("JSON data: " + json_data)
@@ -47,9 +35,9 @@ class UnrestrictLi(Account):
self.logError("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry")
return
- post_data = {"username": user, "password": data["password"],
+ post_data = {"username": user, "password": data['password'],
"remember_me": "remember", "signin": "Sign in"}
- self.html = req.load("https://unrestrict.li/sign_in", post=post_data)
+ html = req.load("https://unrestrict.li/sign_in", post=post_data)
- if 'sign_out' not in self.html:
+ if 'sign_out' not in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index 02f31c544..9db496bbc 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
import re
from time import time
@@ -25,12 +8,14 @@ from module.plugins.Account import Account
class UploadedTo(Account):
__name__ = "UploadedTo"
- __version__ = "0.26"
__type__ = "account"
+ __version__ = "0.26"
+
__description__ = """Uploaded.to account plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def loadAccountInfo(self, user, req):
req.load("http://uploaded.net/language/en")
@@ -62,7 +47,7 @@ class UploadedTo(Account):
req.load("http://uploaded.net/language/en")
req.cj.setCookie("uploaded.net", "lang", "en")
- page = req.load("http://uploaded.net/io/login", post={"id": user, "pw": data["password"], "_": ""})
+ page = req.load("http://uploaded.net/io/login", post={"id": user, "pw": data['password'], "_": ""})
if "User and password do not match!" in page:
self.wrongPassword()
diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py
index 8adcff4ac..20f209268 100644
--- a/module/plugins/accounts/UploadheroCom.py
+++ b/module/plugins/accounts/UploadheroCom.py
@@ -9,12 +9,14 @@ from module.plugins.Account import Account
class UploadheroCom(Account):
__name__ = "UploadheroCom"
- __version__ = "0.2"
__type__ = "account"
+ __version__ = "0.2"
+
__description__ = """Uploadhero.co account plugin"""
__author_name__ = "mcmyst"
__author_mail__ = "mcmyst@hotmail.fr"
+
def loadAccountInfo(self, user, req):
premium_pattern = re.compile('Il vous reste <span class="bleu">([0-9]+)</span> jours premium.')
@@ -32,7 +34,7 @@ class UploadheroCom(Account):
def login(self, user, data, req):
page = req.load("http://uploadhero.co/lib/connexion.php",
- post={"pseudo_login": user, "password_login": data["password"]})
+ post={"pseudo_login": user, "password_login": data['password']})
if "mot de passe invalide" in page:
self.wrongPassword()
diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py
index f0395c13a..416a29b1e 100644
--- a/module/plugins/accounts/UploadingCom.py
+++ b/module/plugins/accounts/UploadingCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from time import time, strptime, mktime
import re
@@ -25,12 +8,14 @@ from module.plugins.Account import Account
class UploadingCom(Account):
__name__ = "UploadingCom"
- __version__ = "0.1"
__type__ = "account"
+ __version__ = "0.1"
+
__description__ = """Uploading.com account plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def loadAccountInfo(self, user, req):
src = req.load("http://uploading.com/")
premium = True
@@ -52,4 +37,4 @@ class UploadingCom(Account):
req.cj.setCookie("uploading.com", "_lang", "en")
req.load("http://uploading.com/")
req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000),
- post={"email": user, "password": data["password"], "remember": "on"})
+ post={"email": user, "password": data['password'], "remember": "on"})
diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py
index 3757ae0aa..60de213ae 100644
--- a/module/plugins/accounts/UptoboxCom.py
+++ b/module/plugins/accounts/UptoboxCom.py
@@ -5,8 +5,9 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class UptoboxCom(XFSPAccount):
__name__ = "UptoboxCom"
- __version__ = "0.02"
__type__ = "account"
+ __version__ = "0.02"
+
__description__ = """DDLStorage.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/accounts/Vipleech4uCom.py b/module/plugins/accounts/Vipleech4uCom.py
deleted file mode 100644
index 1e8463456..000000000
--- a/module/plugins/accounts/Vipleech4uCom.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-import re
-from time import mktime, strptime
-
-from module.plugins.Account import Account
-
-
-class Vipleech4uCom(Account):
- __name__ = "Vipleech4uCom"
- __version__ = "0.1"
- __type__ = "account"
- __description__ = """Vipleech4u.com account plugin"""
- __author_name__ = ("Kagenoshin")
- __author_mail__ = ("kagenoshin@gmx.ch")
-
- STATUS_PATTERN = re.compile(r'status.*?<\s*?strong\s*?>[^<]*?vip[^<]*?<', re.I)
- VALIDUNTIL_PATTERN = re.compile(r'valid\s*?until.*?<\s*?strong\s*?>([^<]*?)<', re.I)
-
- def loadAccountInfo(self, user, req):
- response = req.load("http://vipleech4u.com", decode=True)
- status = self.STATUS_PATTERN.search(response)
-
- validuntil = self.VALIDUNTIL_PATTERN.search(response)
- if validuntil:
- validuntil = validuntil.group(1)
-
- if status and validuntil:
- print status
- print validuntil
- return {"trafficleft": -1, "validuntil": mktime(strptime("%s 23:59" % validuntil, "%d-%m-%Y %H:%M"))}
- else:
- return {"premium": False}
-
- def login(self, user, data, req):
- self.loginname = user
- self.password = data["password"]
- post_data = {'action': 'login', 'user': self.loginname, 'pass': self.password}
- req.load("http://vipleech4u.com/login.php")
- response = req.load("http://vipleech4u.com/login.php", post=post_data, decode=True)
- if 'Username or Password are incorrect' in response:
- self.wrongPassword()
diff --git a/module/plugins/accounts/WarserverCz.py b/module/plugins/accounts/WarserverCz.py
deleted file mode 100644
index a5acf5e52..000000000
--- a/module/plugins/accounts/WarserverCz.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
-import re
-
-from module.plugins.Account import Account
-from module.utils import parseFileSize
-
-
-class WarserverCz(Account):
- __name__ = "WarserverCz"
- __version__ = "0.02"
- __type__ = "account"
- __description__ = """Warserver.cz account plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
-
- VALID_UNTIL_PATTERN = ur'<li>Neomezené stahování do: <strong>(.+?)<'
- TRAFFIC_LEFT_PATTERN = ur'<li>Kredit: <strong>(.+?)<'
-
- DOMAIN = "http://www.warserver.cz"
-
- def loadAccountInfo(self, user, req):
- html = req.load("%s/uzivatele/prehled" % self.DOMAIN, decode=True)
-
- validuntil = trafficleft = None
- premium = False
-
- found = re.search(self.VALID_UNTIL_PATTERN, html)
- if found:
- self.logDebug("VALID_UNTIL", found.group(1))
- try:
- #validuntil = mktime(strptime(found.group(1), "%d %B %Y"))
- premium = True
- trafficleft = -1
- except Exception, e:
- self.logError(e)
-
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if found:
- self.logDebug("TRAFFIC_LEFT", found.group(1))
- trafficleft = parseFileSize((found.group(1).replace("&thinsp;", ""))) // 1024
- premium = True if trafficleft > 1 << 18 else False
-
- return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
-
- def login(self, user, data, req):
- html = req.load('%s/uzivatele/prihlaseni?do=prihlaseni-submit' % self.DOMAIN,
- post={"username": user, "password": data['password'], "send": u"Přihlásit"}, decode=True)
-
- if '<p class="chyba">' in html:
- self.wrongPassword()
diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py
index 75aae25b9..be62d3f40 100644
--- a/module/plugins/accounts/YibaishiwuCom.py
+++ b/module/plugins/accounts/YibaishiwuCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Account import Account
@@ -24,21 +7,23 @@ from module.plugins.Account import Account
class YibaishiwuCom(Account):
__name__ = "YibaishiwuCom"
- __version__ = "0.01"
__type__ = "account"
+ __version__ = "0.01"
+
__description__ = """115.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
ACCOUNT_INFO_PATTERN = r'var USER_PERMISSION = {(.*?)}'
+
def loadAccountInfo(self, user, req):
#self.relogin(user)
html = req.load("http://115.com/", decode=True)
- found = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S)
- premium = True if (found and 'is_vip: 1' in found.group(1)) else False
- validuntil = trafficleft = (-1 if found else 0)
+ m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S)
+ premium = True if (m and 'is_vip: 1' in m.group(1)) else False
+ validuntil = trafficleft = (-1 if m else 0)
return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})
def login(self, user, data, req):
diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py
index 1eb90801a..db1ebd4ae 100644
--- a/module/plugins/accounts/ZeveraCom.py
+++ b/module/plugins/accounts/ZeveraCom.py
@@ -7,12 +7,14 @@ from module.plugins.Account import Account
class ZeveraCom(Account):
__name__ = "ZeveraCom"
- __version__ = "0.21"
__type__ = "account"
+ __version__ = "0.21"
+
__description__ = """Zevera.com account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def loadAccountInfo(self, user, req):
data = self.getAPIData(req)
if data == "No traffic":
@@ -27,7 +29,7 @@ class ZeveraCom(Account):
def login(self, user, data, req):
self.loginname = user
- self.password = data["password"]
+ self.password = data['password']
if self.getAPIData(req) == "No traffic":
self.wrongPassword()
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py
index 8aec97f6a..ee92beb9a 100644
--- a/module/plugins/container/CCF.py
+++ b/module/plugins/container/CCF.py
@@ -1,22 +1,28 @@
# -*- coding: utf-8 -*-
import re
+
+from os import makedirs
+from os.path import exists
from urllib2 import build_opener
-from module.plugins.Container import Container
from module.lib.MultipartPostHandler import MultipartPostHandler
-from os import makedirs
-from os.path import exists, join
+from module.plugins.Container import Container
+from module.utils import save_join
+
class CCF(Container):
__name__ = "CCF"
__version__ = "0.2"
+
__pattern__ = r'.+\.ccf'
+
__description__ = """CCF container decrypter plugin"""
__author_name__ = "Willnix"
__author_mail__ = "Willnix@pyload.org"
+
def decrypt(self, pyfile):
infile = pyfile.url.replace("\n", "")
@@ -28,13 +34,10 @@ class CCF(Container):
tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read()
download_folder = self.config['general']['download_folder']
- location = download_folder #join(download_folder, pyfile.package().folder.decode(sys.getfilesystemencoding()))
- if not exists(location):
- makedirs(location)
- tempdlc_name = join(location, "tmp_%s.dlc" % pyfile.name)
+ tempdlc_name = save_join(download_folder, "tmp_%s.dlc" % pyfile.name)
tempdlc = open(tempdlc_name, "w")
tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1))
tempdlc.close()
- self.packages.append((tempdlc_name, [tempdlc_name], tempdlc_name))
+ self.urls = [tempdlc_name]
diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py
index 79678954d..7e418bd67 100644
--- a/module/plugins/container/LinkList.py
+++ b/module/plugins/container/LinkList.py
@@ -1,19 +1,24 @@
# -*- coding: utf-8 -*-
import codecs
-from module.utils import fs_encode
+
from module.plugins.Container import Container
+from module.utils import fs_encode
+
class LinkList(Container):
__name__ = "LinkList"
__version__ = "0.12"
+
__pattern__ = r'.+\.txt'
- __description__ = """Read link lists in txt format"""
__config__ = [("clear", "bool", "Clear Linklist after adding", False),
("encoding", "string", "File encoding (default utf-8)", "")]
+
+ __description__ = """Read link lists in txt format"""
__author_name__ = ("spoob", "jeix")
__author_mail__ = ("spoob@pyload.org", "jeix@hasnomail.com")
+
def decrypt(self, pyfile):
try:
file_enc = codecs.lookup(self.getConfig("encoding")).name
@@ -33,7 +38,8 @@ class LinkList(Container):
for link in links:
link = link.strip()
- if not link: continue
+ if not link:
+ continue
if link.startswith(";"):
continue
@@ -61,7 +67,7 @@ class LinkList(Container):
txt = open(file_name, 'wb')
txt.close()
except:
- self.log.warning(_("LinkList could not be cleared."))
+ self.logWarning(_("LinkList could not be cleared."))
for name, links in packages.iteritems():
self.packages.append((name, links, name))
diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py
index 42296f2d5..c35efacc6 100644
--- a/module/plugins/container/RSDF.py
+++ b/module/plugins/container/RSDF.py
@@ -6,14 +6,18 @@ import re
from module.plugins.Container import Container
+
class RSDF(Container):
__name__ = "RSDF"
- __version__ = "0.21"
+ __version__ = "0.22"
+
__pattern__ = r'.+\.rsdf'
+
__description__ = """RSDF container decrypter plugin"""
__author_name__ = ("RaNaN", "spoob")
__author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org")
+
def decrypt(self, pyfile):
from Crypto.Cipher import AES
@@ -36,12 +40,12 @@ class RSDF(Container):
data = binascii.unhexlify(''.join(data.split()))
data = data.splitlines()
- links = []
for link in data:
+ if not link:
+ continue
link = base64.b64decode(link)
link = obj.decrypt(link)
decryptedUrl = link.replace('CCF: ', '')
- links.append(decryptedUrl)
+ self.urls.append(decryptedUrl)
self.log.debug("%s: adding package %s with %d links" % (self.__name__,pyfile.package().name,len(links)))
- self.packages.append((pyfile.package().name, links))
diff --git a/module/plugins/crypter/BitshareComFolder.py b/module/plugins/crypter/BitshareComFolder.py
index 7139c26a6..219dabce8 100644
--- a/module/plugins/crypter/BitshareComFolder.py
+++ b/module/plugins/crypter/BitshareComFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.SimpleCrypter import SimpleCrypter
@@ -20,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class BitshareComFolder(SimpleCrypter):
__name__ = "BitshareComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?bitshare\.com/\?d=\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?bitshare\.com/\?d=\w+'
+
__description__ = """Bitshare.com folder decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/crypter/C1neonCom.py b/module/plugins/crypter/C1neonCom.py
index 8923cfc32..829ed63d6 100644
--- a/module/plugins/crypter/C1neonCom.py
+++ b/module/plugins/crypter/C1neonCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class C1neonCom(DeadCrypter):
__name__ = "C1neonCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?c1neon.com/.*?'
__version__ = "0.05"
+
+ __pattern__ = r'http://(?:www\.)?c1neon.com/.*?'
+
__description__ = """C1neon.com decrypter plugin"""
__author_name__ = "godofdream"
__author_mail__ = "soilfiction@gmail.com"
diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py
index 529ec6918..a75cc5e0e 100644
--- a/module/plugins/crypter/ChipDe.py
+++ b/module/plugins/crypter/ChipDe.py
@@ -7,18 +7,21 @@ from module.plugins.Crypter import Crypter
class ChipDe(Crypter):
__name__ = "ChipDe"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?chip.de/video/.*\.html'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?chip.de/video/.*\.html'
+
__description__ = """Chip.de decrypter plugin"""
__author_name__ = "4Christopher"
__author_mail__ = "4Christopher@gmx.de"
+
def decrypt(self, pyfile):
self.html = self.load(pyfile.url)
try:
- url = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html).group(1)
- self.logDebug('The file URL is %s' % url)
+ f = re.search(r'"(http://video.chip.de/\d+?/.*)"', self.html)
except:
self.fail('Failed to find the URL')
-
- self.packages.append((pyfile.package().name, [url], pyfile.package().folder))
+ else:
+ self.urls = [f.group(1)]
+ self.logDebug('The file URL is %s' % self.urls[0])
diff --git a/module/plugins/crypter/CrockoComFolder.py b/module/plugins/crypter/CrockoComFolder.py
index e64e63534..56abeac29 100644
--- a/module/plugins/crypter/CrockoComFolder.py
+++ b/module/plugins/crypter/CrockoComFolder.py
@@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class CrockoComFolder(SimpleCrypter):
__name__ = "CrockoComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?crocko.com/f/.*'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?crocko.com/f/.*'
+
__description__ = """Crocko.com folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/crypter/CryptItCom.py b/module/plugins/crypter/CryptItCom.py
index 6f8fbaa1a..66c5e7ca7 100644
--- a/module/plugins/crypter/CryptItCom.py
+++ b/module/plugins/crypter/CryptItCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class CryptItCom(DeadCrypter):
__name__ = "CryptItCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/[\w]+'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/[\w]+'
+
__description__ = """Crypt-it.com decrypter plugin"""
__author_name__ = "jeix"
__author_mail__ = "jeix@hasnomail.de"
diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py
index d1ba8335c..64affc867 100644
--- a/module/plugins/crypter/CzshareComFolder.py
+++ b/module/plugins/crypter/CzshareComFolder.py
@@ -7,25 +7,25 @@ from module.plugins.Crypter import Crypter
class CzshareComFolder(Crypter):
__name__ = "CzshareComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*'
__version__ = "0.2"
+
+ __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*'
+
__description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FOLDER_PATTERN = r'<tr class="subdirectory">\s*<td>\s*<table>(.*?)</table>'
LINK_PATTERN = r'<td class="col2"><a href="([^"]+)">info</a></td>'
- #NEXT_PAGE_PATTERN = r'<a class="next " href="/([^"]+)">&nbsp;</a>'
+
def decrypt(self, pyfile):
html = self.load(pyfile.url)
- new_links = []
- found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None: self.fail("Parse error (FOLDER)")
- new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))
+ m = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
+ if m is None:
+ self.fail("Parse error (FOLDER)")
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1)))
+ if not self.urls:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py
index 27cff3f9d..f5e7203d3 100644
--- a/module/plugins/crypter/DDLMusicOrg.py
+++ b/module/plugins/crypter/DDLMusicOrg.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
+
from time import sleep
from module.plugins.Crypter import Crypter
@@ -9,12 +10,15 @@ from module.plugins.Crypter import Crypter
class DDLMusicOrg(Crypter):
__name__ = "DDLMusicOrg"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+'
__version__ = "0.3"
+
+ __pattern__ = r'http://(?:www\.)?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+'
+
__description__ = """Ddl-music.org decrypter plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def setup(self):
self.multiDL = False
@@ -39,6 +43,6 @@ class DDLMusicOrg(Crypter):
"linknr": linknr})
m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink)
if m:
- self.packages.append((pyfile.package().name, [m.group(1)], pyfile.package().folder))
+ self.urls = [m.group(1)]
else:
self.retry()
diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py
index 5c0dd9cec..e43d4e1fd 100644
--- a/module/plugins/crypter/DailymotionBatch.py
+++ b/module/plugins/crypter/DailymotionBatch.py
@@ -1,24 +1,8 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Walter Purcaro
-"""
+import re
from urlparse import urljoin
-import re
from module.common.json_layer import json_loads
from module.plugins.Crypter import Crypter
@@ -28,12 +12,15 @@ from module.utils import save_join
class DailymotionBatch(Crypter):
__name__ = "DailymotionBatch"
__type__ = "crypter"
- __pattern__ = r'https?://(?:www\.)?dailymotion\.com/((playlists/)?(?P<TYPE>playlist|user)/)?(?P<ID>[\w^_]+)(?(TYPE)|#)'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?dailymotion\.com/((playlists/)?(?P<TYPE>playlist|user)/)?(?P<ID>[\w^_]+)(?(TYPE)|#)'
+
__description__ = """Dailymotion.com channel & playlist decrypter"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
+
def api_response(self, ref, req=None):
url = urljoin("https://api.dailymotion.com/", ref)
page = self.load(url, get=req)
@@ -47,8 +34,8 @@ class DailymotionBatch(Crypter):
if "error" in playlist:
return
- name = playlist["name"]
- owner = playlist["owner.screenname"]
+ name = playlist['name']
+ owner = playlist['owner.screenname']
return name, owner
def _getPlaylists(self, user_id, page=1):
@@ -59,10 +46,10 @@ class DailymotionBatch(Crypter):
if "error" in user:
return
- for playlist in user["list"]:
- yield playlist["id"]
+ for playlist in user['list']:
+ yield playlist['id']
- if user["has_more"]:
+ if user['has_more']:
for item in self._getPlaylists(user_id, page + 1):
yield item
@@ -77,10 +64,10 @@ class DailymotionBatch(Crypter):
if "error" in playlist:
return
- for video in playlist["list"]:
- yield video["url"]
+ for video in playlist['list']:
+ yield video['url']
- if playlist["has_more"]:
+ if playlist['has_more']:
for item in self._getVideos(id, page + 1):
yield item
diff --git a/module/plugins/crypter/DataHuFolder.py b/module/plugins/crypter/DataHuFolder.py
index 04ef152fc..4f6116100 100644
--- a/module/plugins/crypter/DataHuFolder.py
+++ b/module/plugins/crypter/DataHuFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
@@ -22,8 +8,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class DataHuFolder(SimpleCrypter):
__name__ = "DataHuFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?data.hu/dir/\w+'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?data.hu/dir/\w+'
+
__description__ = """Data.hu folder decrypter plugin"""
__author_name__ = ("crash", "stickell")
__author_mail__ = "l.stickell@yahoo.it"
@@ -31,6 +19,7 @@ class DataHuFolder(SimpleCrypter):
LINK_PATTERN = r"<a href='(http://data\.hu/get/.+)' target='_blank'>\1</a>"
TITLE_PATTERN = ur'<title>(?P<title>.+) Let\xf6lt\xe9se</title>'
+
def decrypt(self, pyfile):
self.html = self.load(pyfile.url, decode=True)
diff --git a/module/plugins/crypter/DdlstorageComFolder.py b/module/plugins/crypter/DdlstorageComFolder.py
index 6501de822..3b1dc6dd6 100644
--- a/module/plugins/crypter/DdlstorageComFolder.py
+++ b/module/plugins/crypter/DdlstorageComFolder.py
@@ -1,29 +1,18 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-from module.plugins.internal.SimpleCrypter import SimpleCrypter
+from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo
-class DdlstorageComFolder(SimpleCrypter):
+class DdlstorageComFolder(DeadCrypter):
__name__ = "DdlstorageComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?ddlstorage.com/folder/\w{10}'
- __version__ = "0.02"
+ __version__ = "0.03"
+
+ __pattern__ = r'https?://(?:www\.)?ddlstorage\.com/folder/\w+'
+
__description__ = """DDLStorage.com folder decrypter plugin"""
__author_name__ = ("godofdream", "stickell")
__author_mail__ = ("soilfiction@gmail.com", "l.stickell@yahoo.it")
- LINK_PATTERN = '<a class="sub_title" style="text-decoration:none;" href="(http://www.ddlstorage.com/.*)">'
+
+getInfo = create_getInfo(SpeedLoadOrg)
diff --git a/module/plugins/crypter/DepositfilesComFolder.py b/module/plugins/crypter/DepositfilesComFolder.py
index 74d199e12..b7c273f0b 100644
--- a/module/plugins/crypter/DepositfilesComFolder.py
+++ b/module/plugins/crypter/DepositfilesComFolder.py
@@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class DepositfilesComFolder(SimpleCrypter):
__name__ = "DepositfilesComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?depositfiles.com/folders/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?depositfiles.com/folders/\w+'
+
__description__ = """Depositfiles.com folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py
index 4b6309c17..21529ddfd 100644
--- a/module/plugins/crypter/Dereferer.py
+++ b/module/plugins/crypter/Dereferer.py
@@ -1,22 +1,8 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-"""
-
import re
-import urllib
+
+from urllib import unquote
from module.plugins.Crypter import Crypter
@@ -24,12 +10,15 @@ from module.plugins.Crypter import Crypter
class Dereferer(Crypter):
__name__ = "Dereferer"
__type__ = "crypter"
- __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)'
__version__ = "0.1"
+
+ __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)'
+
__description__ = """Crypter for dereferers"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def decrypt(self, pyfile):
link = re.match(self.__pattern__, pyfile.url).group('url')
- self.core.files.addLinks([urllib.unquote(link).rstrip('+')], pyfile.package().id)
+ self.urls = [unquote(link).rstrip('+')]
diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py
index dbe5bf705..4c958437a 100644
--- a/module/plugins/crypter/DlProtectCom.py
+++ b/module/plugins/crypter/DlProtectCom.py
@@ -1,22 +1,7 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
import re
+
from base64 import urlsafe_b64encode
from time import time
@@ -26,13 +11,16 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class DlProtectCom(SimpleCrypter):
__name__ = "DlProtectCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P<ID>\w+)'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?dl-protect\.com/((en|fr)/)?(?P<ID>\w+)'
+
__description__ = """Dl-protect.com decrypter plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
- OFFLINE_PATTERN = ">Unfortunately, the link you are looking for is not found"
+ OFFLINE_PATTERN = r'>Unfortunately, the link you are looking for is not found'
+
def getLinks(self):
# Direct link with redirect
@@ -55,14 +43,14 @@ class DlProtectCom(SimpleCrypter):
post_req.update({"i": b64time, "submitform": "Decrypt+link"})
if ">Password :" in self.html:
- post_req["pwd"] = self.getPassword()
+ post_req['pwd'] = self.getPassword()
if ">Security Code" in self.html:
captcha_id = re.search(r'/captcha\.php\?uid=(.+?)"', self.html).group(1)
captcha_url = "http://www.dl-protect.com/captcha.php?uid=" + captcha_id
captcha_code = self.decryptCaptcha(captcha_url, imgtype="gif")
- post_req["secure"] = captcha_code
+ post_req['secure'] = captcha_code
self.html = self.load(self.pyfile.url, post=post_req)
diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py
index 42a38e98f..23fbb8d52 100644
--- a/module/plugins/crypter/DontKnowMe.py
+++ b/module/plugins/crypter/DontKnowMe.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
import re
-import urllib
+
+from urllib import unquote
from module.plugins.Crypter import Crypter
@@ -9,14 +10,17 @@ from module.plugins.Crypter import Crypter
class DontKnowMe(Crypter):
__name__ = "DontKnowMe"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?dontknow.me/at/\?.+$'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?dontknow.me/at/\?.+$'
+
__description__ = """DontKnow.me decrypter plugin"""
__author_name__ = "selaux"
- __author_mail__ = ""
+ __author_mail__ = None
+
+ LINK_PATTERN = r'http://dontknow.me/at/\?(.+)$'
- LINK_PATTERN = r"http://dontknow.me/at/\?(.+)$"
def decrypt(self, pyfile):
link = re.findall(self.LINK_PATTERN, pyfile.url)[0]
- self.core.files.addLinks([urllib.unquote(link)], pyfile.package().id)
+ self.urls = [unquote(link)]
diff --git a/module/plugins/crypter/DownloadVimeoCom.py b/module/plugins/crypter/DownloadVimeoCom.py
deleted file mode 100644
index 3e137bab1..000000000
--- a/module/plugins/crypter/DownloadVimeoCom.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import re
-import HTMLParser
-from module.plugins.Crypter import Crypter
-
-
-class DownloadVimeoCom(Crypter):
- __name__ = 'DownloadVimeoCom'
- __type__ = 'crypter'
- __pattern__ = r'(?:http://vimeo\.com/\d*|http://smotri\.com/video/view/\?id=.*)'
- __version__ = '0.1'
- __description__ = """Vimeo.com decrypter plugin"""
- __author_name__ = "4Christopher"
- __author_mail__ = "4Christopher@gmx.de"
-
- BASE_URL = 'http://downloadvimeo.com'
-
- def decrypt(self, pyfile):
- self.package = pyfile.package()
- html = self.load('%s/generate?url=%s' % (self.BASE_URL, pyfile.url))
- h = HTMLParser.HTMLParser()
- try:
- f = re.search(r'cmd quality="(?P<quality>[^"]+?)">\s*?(?P<URL>[^<]*?)</cmd>', html)
- except:
- self.logDebug('Failed to find the URL')
- else:
- url = h.unescape(f.group('URL'))
- self.logDebug('Quality: %s, URL: %s' % (f.group('quality'), url))
- self.packages.append((self.package.name, [url], self.package.folder))
diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py
index f44bac2e9..e7a5a59e9 100644
--- a/module/plugins/crypter/DuckCryptInfo.py
+++ b/module/plugins/crypter/DuckCryptInfo.py
@@ -1,48 +1,52 @@
# -*- coding: utf-8 -*-
import re
+
from module.lib.BeautifulSoup import BeautifulSoup
+
from module.plugins.Crypter import Crypter
class DuckCryptInfo(Crypter):
__name__ = "DuckCryptInfo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)'
+
__description__ = """DuckCrypt.info decrypter plugin"""
__author_name__ = "godofdream"
__author_mail__ = "soilfiction@gmail.com"
TIMER_PATTERN = r'<span id="timer">(.*)</span>'
+
def decrypt(self, pyfile):
url = pyfile.url
# seems we don't need to wait
#src = self.req.load(str(url))
- #found = re.search(self.TIMER_PATTERN, src)
- #if found:
- # self.logDebug("Sleeping for" % found.group(1))
- # self.setWait(int(found.group(1)) ,False)
- found = re.match(self.__pattern__, url)
- if not found:
+ #m = re.search(self.TIMER_PATTERN, src)
+ #if m:
+ # self.logDebug("Sleeping for" % m.group(1))
+ # self.setWait(int(m.group(1)) ,False)
+ m = re.match(self.__pattern__, url)
+ if m is None:
self.fail('Weird error in link')
- if str(found.group(1)) == "link":
+ if str(m.group(1)) == "link":
self.handleLink(url)
else:
- self.handleFolder(found)
+ self.handleFolder(m)
-
- def handleFolder(self, found):
- src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2)))
- found = re.match(self.__pattern__, src)
- self.logDebug("Redirectet to " + str(found.group(0)))
- src = self.load(str(found.group(0)))
+ def handleFolder(self, m):
+ src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2)))
+ m = re.match(self.__pattern__, src)
+ self.logDebug("Redirectet to " + str(m.group(0)))
+ src = self.load(str(m.group(0)))
soup = BeautifulSoup(src)
cryptlinks = soup.findAll("div", attrs={"class": "folderbox"})
self.logDebug("Redirectet to " + str(cryptlinks))
if not cryptlinks:
- self.fail('no links found - (Plugin out of date?)')
+ self.fail('no links m - (Plugin out of date?)')
for clink in cryptlinks:
if clink.find("a"):
self.handleLink(clink.find("a")['href'])
@@ -50,8 +54,6 @@ class DuckCryptInfo(Crypter):
def handleLink(self, url):
src = self.load(url)
soup = BeautifulSoup(src)
- link = soup.find("iframe")["src"]
- if not link:
- self.logDebug('no links found - (Plugin out of date?)')
- else:
- self.core.files.addLinks([link], self.pyfile.package().id)
+ self.urls = [soup.find("iframe")['src']]
+ if not self.urls:
+ self.logDebug('no links m - (Plugin out of date?)')
diff --git a/module/plugins/crypter/DuploadOrgFolder.py b/module/plugins/crypter/DuploadOrgFolder.py
index 4913bdf2e..6f764f687 100644
--- a/module/plugins/crypter/DuploadOrgFolder.py
+++ b/module/plugins/crypter/DuploadOrgFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.SimpleCrypter import SimpleCrypter
@@ -20,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class DuploadOrgFolder(SimpleCrypter):
__name__ = "DuploadOrgFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?dupload\.org/folder/\d+/'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?dupload\.org/folder/\d+/'
+
__description__ = """Dupload.org folder decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/crypter/EasybytezComFolder.py b/module/plugins/crypter/EasybytezComFolder.py
index b4a6284fc..7832bef5f 100644
--- a/module/plugins/crypter/EasybytezComFolder.py
+++ b/module/plugins/crypter/EasybytezComFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.SimpleCrypter import SimpleCrypter
@@ -20,13 +6,15 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class EasybytezComFolder(SimpleCrypter):
__name__ = "EasybytezComFolder"
__type__ = "crypter"
+ __version__ = "0.06"
+
__pattern__ = r'http://(?:www\.)?easybytez\.com/users/(?P<ID>\d+/\d+)'
- __version__ = "0.05"
+
__description__ = """Easybytez.com decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
- FILE_URL_REPLACEMENTS = [(__pattern__, r"http://www.easybytez.com/users/\g<ID>?per_page=10000")]
+ URL_REPLACEMENTS = [(__pattern__, r"http://www.easybytez.com/users/\g<ID>?per_page=10000")]
LINK_PATTERN = r'<td><a href="(http://www\.easybytez\.com/\w+)" target="_blank">.+(?:</a>)?</td>'
TITLE_PATTERN = r'<Title>Files of \d+: (?P<title>.+) folder</Title>'
diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py
index fbccf71aa..6b876ed7f 100644
--- a/module/plugins/crypter/EmbeduploadCom.py
+++ b/module/plugins/crypter/EmbeduploadCom.py
@@ -8,42 +8,43 @@ from module.network.HTTPRequest import BadHeader
class EmbeduploadCom(Crypter):
__name__ = "EmbeduploadCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?embedupload.com/\?d=.*'
__version__ = "0.02"
- __description__ = """EmbedUpload.com decrypter plugin"""
+
+ __pattern__ = r'http://(?:www\.)?embedupload.com/\?d=.*'
__config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "embedupload"),
("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")]
+
+ __description__ = """EmbedUpload.com decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
LINK_PATTERN = r'<div id="([^"]+)"[^>]*>\s*<a href="([^"]+)" target="_blank" (?:class="DownloadNow"|style="color:red")>'
+
def decrypt(self, pyfile):
self.html = self.load(pyfile.url, decode=True)
tmp_links = []
- new_links = []
- found = re.findall(self.LINK_PATTERN, self.html)
- if found:
+ m = re.findall(self.LINK_PATTERN, self.html)
+ if m:
prefered_set = set(self.getConfig("preferedHoster").split('|'))
prefered_set = map(lambda s: s.lower().split('.')[0], prefered_set)
print "PF", prefered_set
- tmp_links.extend([x[1] for x in found if x[0] in prefered_set])
- self.getLocation(tmp_links, new_links)
+ tmp_links.extend([x[1] for x in m if x[0] in prefered_set])
+ self.urls = self.getLocation(tmp_links)
- if not new_links:
+ if not self.urls:
ignored_set = set(self.getConfig("ignoredHoster").split('|'))
ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set)
print "IG", ignored_set
- tmp_links.extend([x[1] for x in found if x[0] not in ignored_set])
- self.getLocation(tmp_links, new_links)
+ tmp_links.extend([x[1] for x in m if x[0] not in ignored_set])
+ self.urls = self.getLocation(tmp_links)
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ if not self.urls:
self.fail('Could not extract any links')
- def getLocation(self, tmp_links, new_links):
+ def getLocation(self, tmp_links):
+ new_links = []
for link in tmp_links:
try:
header = self.load(link, just_header=True)
@@ -51,3 +52,4 @@ class EmbeduploadCom(Crypter):
new_links.append(header['location'])
except BadHeader:
pass
+ return new_links
diff --git a/module/plugins/crypter/FilebeerInfoFolder.py b/module/plugins/crypter/FilebeerInfoFolder.py
index f5818e072..0743dcb0f 100644
--- a/module/plugins/crypter/FilebeerInfoFolder.py
+++ b/module/plugins/crypter/FilebeerInfoFolder.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class FilebeerInfoFolder(DeadCrypter):
__name__ = "FilebeerInfoFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?filebeer\.info/(\d+~f).*'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?filebeer\.info/(\d+~f).*'
+
__description__ = """Filebeer.info folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/crypter/FilecloudIoFolder.py b/module/plugins/crypter/FilecloudIoFolder.py
new file mode 100644
index 000000000..9ec950061
--- /dev/null
+++ b/module/plugins/crypter/FilecloudIoFolder.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class FilecloudIoFolder(SimpleCrypter):
+ __name__ = "FilecloudIoFolder"
+ __type__ = "crypter"
+ __version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?(filecloud\.io|ifile\.it)/_\w+'
+
+ __description__ = """Filecloud.io folder decrypter plugin"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
+
+ LINK_PATTERN = r'href="(http://filecloud.io/\w+)" title'
+ TITLE_PATTERN = r'>(?P<title>.+?) - filecloud.io<'
diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py
index aece1a01d..562c56732 100644
--- a/module/plugins/crypter/FilefactoryComFolder.py
+++ b/module/plugins/crypter/FilefactoryComFolder.py
@@ -1,45 +1,25 @@
# -*- coding: utf-8 -*-
-import re
-from module.plugins.Crypter import Crypter
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
-class FilefactoryComFolder(Crypter):
+class FilefactoryComFolder(SimpleCrypter):
__name__ = "FilefactoryComFolder"
__type__ = "crypter"
- __pattern__ = r'(http://(?:www\.)?filefactory\.com/f/\w+).*'
- __version__ = "0.1"
+ __version__ = "0.2"
+
+ __pattern__ = r'https?://(?:www\.)?filefactory\.com/(?:f|folder)/\w+'
+
__description__ = """Filefactory.com folder decrypter plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
-
- FOLDER_PATTERN = r'<table class="items" cellspacing="0" cellpadding="0">(.*?)</table>'
- LINK_PATTERN = r'<td class="name"><a href="([^"]+)">'
- PAGINATOR_PATTERN = r'<div class="list">\s*<label>Pages</label>\s*<ul>(.*?)</ul>\s*</div>'
- NEXT_PAGE_PATTERN = r'<li class="current">.*?</li>\s*<li class=""><a href="([^"]+)">'
-
- def decrypt(self, pyfile):
- url_base = re.match(self.__pattern__, pyfile.url).group(1)
- html = self.load(url_base)
-
- new_links = []
- for i in xrange(1, 100):
- self.logInfo("Fetching links from page %i" % i)
- found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None: self.fail("Parse error (FOLDER)")
-
- new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))
-
- try:
- paginator = re.search(self.PAGINATOR_PATTERN, html, re.DOTALL).group(1)
- next_page = re.search(self.NEXT_PAGE_PATTERN, paginator).group(1)
- html = self.load("%s/%s" % (url_base, next_page))
- except Exception, e:
- break
- else:
- self.logInfo("Limit of 99 pages reached, aborting")
-
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
- self.fail('Could not extract any links')
+ __author_name__ = "stickell"
+ __author_mail__ = "l.stickell@yahoo.it"
+
+ LINK_PATTERN = r'<td><a href="([^"]+)">'
+ TITLE_PATTERN = r'<h1>Files in <span>(?P<title>.+)</span></h1>'
+ PAGES_PATTERN = r'data-paginator-totalPages="(?P<pages>\d+)"'
+
+ SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')]
+
+
+ def loadPage(self, page_n):
+ return self.load(self.pyfile.url, get={'page': page_n})
diff --git a/module/plugins/crypter/FilerNetFolder.py b/module/plugins/crypter/FilerNetFolder.py
new file mode 100644
index 000000000..9951661b5
--- /dev/null
+++ b/module/plugins/crypter/FilerNetFolder.py
@@ -0,0 +1,22 @@
+import re
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class FilerNetFolder(SimpleCrypter):
+ __name__ = "FilerNetFolder"
+ __type__ = "crypter"
+ __version__ = "0.3"
+
+ __pattern__ = r'https?://filer\.net/folder/\w{16}'
+
+ __description__ = """Filer.net decrypter plugin"""
+ __author_name_ = ("nath_schwarz", "stickell")
+ __author_mail_ = ("nathan.notwhite@gmail.com", "l.stickell@yahoo.it")
+
+ LINK_PATTERN = r'href="(/get/\w{16})">(?!<)'
+ TITLE_PATTERN = r'<h3>(?P<title>.+) - <small'
+
+
+ def getLinks(self):
+ return ['http://filer.net%s' % link for link in re.findall(self.LINK_PATTERN, self.html)]
diff --git a/module/plugins/crypter/FileserveComFolder.py b/module/plugins/crypter/FileserveComFolder.py
index c3c8b58fe..2db6baf0e 100644
--- a/module/plugins/crypter/FileserveComFolder.py
+++ b/module/plugins/crypter/FileserveComFolder.py
@@ -8,8 +8,10 @@ from module.plugins.Crypter import Crypter
class FileserveComFolder(Crypter):
__name__ = "FileserveComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?fileserve.com/list/\w+'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?fileserve.com/list/\w+'
+
__description__ = """FileServe.com folder decrypter plugin"""
__author_name__ = "fionnc"
__author_mail__ = "fionnc@gmail.com"
@@ -17,17 +19,19 @@ class FileserveComFolder(Crypter):
FOLDER_PATTERN = r'<table class="file_list">(.*?)</table>'
LINK_PATTERN = r'<a href="([^"]+)" class="sheet_icon wbold">'
+
def decrypt(self, pyfile):
html = self.load(pyfile.url)
new_links = []
folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if folder is None: self.fail("Parse error (FOLDER)")
+ if folder is None:
+ self.fail("Parse error (FOLDER)")
new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1)))
if new_links:
- self.core.files.addLinks(map(lambda s: "http://fileserve.com%s" % s, new_links), pyfile.package().id)
+ self.urls = [map(lambda s: "http://fileserve.com%s" % s, new_links)]
else:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/FilestubeCom.py b/module/plugins/crypter/FilestubeCom.py
index f4f09e878..f0aaaa579 100644
--- a/module/plugins/crypter/FilestubeCom.py
+++ b/module/plugins/crypter/FilestubeCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.SimpleCrypter import SimpleCrypter
@@ -20,11 +6,13 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class FilestubeCom(SimpleCrypter):
__name__ = "FilestubeCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?filestube\.(?:com|to)/\w+'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?filestube\.(?:com|to)/\w+'
+
__description__ = """Filestube.com decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
- LINK_PATTERN = r"<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)"
- TITLE_PATTERN = r"<h1\s*> (?P<title>.+) download\s*</h1>"
+ LINK_PATTERN = r'<a class=\"file-link-main(?: noref)?\" [^>]* href=\"(http://[^\"]+)'
+ TITLE_PATTERN = r'<h1\s*> (?P<title>.+) download\s*</h1>'
diff --git a/module/plugins/crypter/FiletramCom.py b/module/plugins/crypter/FiletramCom.py
index 8cdf32ad5..7052955cf 100644
--- a/module/plugins/crypter/FiletramCom.py
+++ b/module/plugins/crypter/FiletramCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.SimpleCrypter import SimpleCrypter
@@ -20,11 +6,13 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class FiletramCom(SimpleCrypter):
__name__ = "FiletramCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?filetram.com/[^/]+/.+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?filetram.com/[^/]+/.+'
+
__description__ = """Filetram.com decrypter plugin"""
__author_name__ = ("igel", "stickell")
__author_mail__ = ("igelkun@myopera.com", "l.stickell@yahoo.it")
- LINK_PATTERN = r"\s+(http://.+)"
- TITLE_PATTERN = r"<title>(?P<title>[^<]+) - Free Download[^<]*</title>"
+ LINK_PATTERN = r'\s+(http://.+)'
+ TITLE_PATTERN = r'<title>(?P<title>[^<]+) - Free Download[^<]*</title>'
diff --git a/module/plugins/crypter/FiredriveComFolder.py b/module/plugins/crypter/FiredriveComFolder.py
new file mode 100644
index 000000000..a94d0847f
--- /dev/null
+++ b/module/plugins/crypter/FiredriveComFolder.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class FiredriveComFolder(SimpleCrypter):
+ __name__ = "FiredriveComFolder"
+ __type__ = "crypter"
+ __version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/share/.+'
+
+ __description__ = """Firedrive.com folder decrypter plugin"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
+
+ LINK_PATTERN = r'<div class="pf_item pf_(file|folder).+?public=\'(.+?)\''
+ TITLE_PATTERN = r'>Shared Folder "(?P<title>.+)" | Firedrive<'
+ OFFLINE_PATTERN = r'class="sad_face_image"|>No such page here.<'
+ TEMP_OFFLINE_PATTERN = r'>(File Temporarily Unavailable|Server Error. Try again later)'
+
+
+ def getLinks(self):
+ return map(lambda x: "http://www.firedrive.com/%s/%s" %
+ ("share" if x[0] == "folder" else "file", x[1]),
+ re.findall(self.LINK_PATTERN, self.html))
diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py
index 010451c46..c497fa799 100644
--- a/module/plugins/crypter/FourChanOrg.py
+++ b/module/plugins/crypter/FourChanOrg.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+#
+# Based on 4chandl by Roland Beermann (https://gist.github.com/enkore/3492599)
import re
@@ -6,20 +8,18 @@ from module.plugins.Crypter import Crypter
class FourChanOrg(Crypter):
- # Based on 4chandl by Roland Beermann
- # https://gist.github.com/enkore/3492599
__name__ = "FourChanOrg"
__type__ = "crypter"
__version__ = "0.3"
+
__pattern__ = r'http://(?:www\.)?boards\.4chan.org/\w+/res/(\d+)'
+
__description__ = """4chan.org folder decrypter plugin"""
+ __author_name__ = None
+ __author_mail__ = None
+
def decrypt(self, pyfile):
pagehtml = self.load(pyfile.url)
-
images = set(re.findall(r'(images\.4chan\.org/[^/]*/src/[^"<]*)', pagehtml))
- urls = []
- for image in images:
- urls.append("http://" + image)
-
- self.core.files.addLinks(urls, pyfile.package().id)
+ self.urls = ["http://" + image for image in images]
diff --git a/module/plugins/crypter/FreakhareComFolder.py b/module/plugins/crypter/FreakhareComFolder.py
index c5df7ff17..2a6877891 100644
--- a/module/plugins/crypter/FreakhareComFolder.py
+++ b/module/plugins/crypter/FreakhareComFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
@@ -22,8 +8,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class FreakhareComFolder(SimpleCrypter):
__name__ = "FreakhareComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?freakshare\.com/folder/.+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?freakshare\.com/folder/.+'
+
__description__ = """Freakhare.com folder decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
@@ -32,6 +20,7 @@ class FreakhareComFolder(SimpleCrypter):
TITLE_PATTERN = r'Folder:</b> (?P<title>.+)'
PAGES_PATTERN = r'Pages: +(?P<pages>\d+)'
+
def loadPage(self, page_n):
if not hasattr(self, 'f_id') and not hasattr(self, 'f_md5'):
m = re.search(r'http://freakshare.com/\?x=folder&f_id=(\d+)&f_md5=(\w+)', self.html)
diff --git a/module/plugins/crypter/FreetexthostCom.py b/module/plugins/crypter/FreetexthostCom.py
index e5c9c3d21..bd8a90ce5 100644
--- a/module/plugins/crypter/FreetexthostCom.py
+++ b/module/plugins/crypter/FreetexthostCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
@@ -22,15 +8,18 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class FreetexthostCom(SimpleCrypter):
__name__ = "FreetexthostCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?freetexthost\.com/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?freetexthost\.com/\w+'
+
__description__ = """Freetexthost.com decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def getLinks(self):
m = re.search(r'<div id="contentsinner">\s*(.+)<div class="viewcount">', self.html, re.DOTALL)
- if not m:
+ if m is None:
self.fail('Unable to extract links | Plugin may be out-of-date')
links = m.group(1)
return links.strip().split("<br />\r\n")
diff --git a/module/plugins/crypter/FshareVnFolder.py b/module/plugins/crypter/FshareVnFolder.py
index 6e67905d9..5976ff6d5 100644
--- a/module/plugins/crypter/FshareVnFolder.py
+++ b/module/plugins/crypter/FshareVnFolder.py
@@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class FshareVnFolder(SimpleCrypter):
__name__ = "FshareVnFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?fshare.vn/folder/.*'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?fshare.vn/folder/.*'
+
__description__ = """Fshare.vn folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py
index 15f0a9a8c..1d9c2801f 100644
--- a/module/plugins/crypter/GooGl.py
+++ b/module/plugins/crypter/GooGl.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.Crypter import Crypter
from module.common.json_layer import json_loads
@@ -21,13 +7,16 @@ from module.common.json_layer import json_loads
class GooGl(Crypter):
__name__ = "GooGl"
__type__ = "crypter"
- __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+'
+
__description__ = """Goo.gl decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
- API_URL = 'https://www.googleapis.com/urlshortener/v1/url'
+ API_URL = "https://www.googleapis.com/urlshortener/v1/url"
+
def decrypt(self, pyfile):
rep = self.load(self.API_URL, get={'shortUrl': pyfile.url})
@@ -35,6 +24,6 @@ class GooGl(Crypter):
rep = json_loads(rep)
if 'longUrl' in rep:
- self.core.files.addLinks([rep['longUrl']], pyfile.package().id)
+ self.urls = [rep['longUrl']]
else:
self.fail('Unable to expand shortened link')
diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py
index c6773b3f0..924ce5d3a 100644
--- a/module/plugins/crypter/HoerbuchIn.py
+++ b/module/plugins/crypter/HoerbuchIn.py
@@ -2,15 +2,18 @@
import re
-from module.plugins.Crypter import Crypter
from module.lib.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
+from module.plugins.Crypter import Crypter
+
class HoerbuchIn(Crypter):
__name__ = "HoerbuchIn"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out.php\?.+|protection/folder_\d+\.html)'
__version__ = "0.6"
+
+ __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out.php\?.+|protection/folder_\d+\.html)'
+
__description__ = """Hoerbuch.in decrypter plugin"""
__author_name__ = ("spoob", "mkaay")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de")
@@ -18,6 +21,7 @@ class HoerbuchIn(Crypter):
article = re.compile("http://(?:www\.)?hoerbuch\.in/wp/horbucher/\d+/.+/")
protection = re.compile("http://(?:www\.)?hoerbuch\.in/protection/folder_\d+.html")
+
def decrypt(self, pyfile):
self.pyfile = pyfile
@@ -28,17 +32,15 @@ class HoerbuchIn(Crypter):
abookname = soup.find("a", attrs={"rel": "bookmark"}).text
for a in soup.findAll("a", attrs={"href": self.protection}):
package = "%s (%s)" % (abookname, a.previousSibling.previousSibling.text[:-1])
- links = self.decryptFolder(a["href"])
+ links = self.decryptFolder(a['href'])
- self.packages.append((package, links, pyfile.package().folder))
+ self.packages.append((package, links, package))
else:
- links = self.decryptFolder(pyfile.url)
-
- self.packages.append((pyfile.package().name, links, pyfile.package().folder))
+ self.urls = self.decryptFolder(pyfile.url)
def decryptFolder(self, url):
m = self.protection.search(url)
- if not m:
+ if m is None:
self.fail("Bad URL")
url = m.group(0)
diff --git a/module/plugins/crypter/HotfileFolderCom.py b/module/plugins/crypter/HotfileFolderCom.py
index 3a4a9d70a..3efd8fc87 100644
--- a/module/plugins/crypter/HotfileFolderCom.py
+++ b/module/plugins/crypter/HotfileFolderCom.py
@@ -8,12 +8,15 @@ from module.plugins.Crypter import Crypter
class HotfileFolderCom(Crypter):
__name__ = "HotfileFolderCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?hotfile.com/list/\w+/\w+'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?hotfile.com/list/\w+/\w+'
+
__description__ = """Hotfile.com folder decrypter plugin"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def decrypt(self, pyfile):
html = self.load(pyfile.url)
@@ -24,4 +27,4 @@ class HotfileFolderCom(Crypter):
new_links = [x[0] for x in new_links]
- self.packages.append((name, new_links, name))
+ self.packages = [(name, new_links, name)]
diff --git a/module/plugins/crypter/ILoadTo.py b/module/plugins/crypter/ILoadTo.py
index 3a388d41f..d7818570a 100644
--- a/module/plugins/crypter/ILoadTo.py
+++ b/module/plugins/crypter/ILoadTo.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class ILoadTo(DeadCrypter):
__name__ = "ILoadTo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?iload\.to/go/\d+-[\w\.-]+/'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?iload\.to/go/\d+-[\w\.-]+/'
+
__description__ = """Iload.to decrypter plugin"""
__author_name__ = "hzpz"
- __author_mail__ = ""
+ __author_mail__ = None
diff --git a/module/plugins/crypter/ImgurComAlbum.py b/module/plugins/crypter/ImgurComAlbum.py
new file mode 100644
index 000000000..eb1f4441a
--- /dev/null
+++ b/module/plugins/crypter/ImgurComAlbum.py
@@ -0,0 +1,24 @@
+import re
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+from module.utils import uniqify
+
+
+class ImgurComAlbum(SimpleCrypter):
+ __name__ = "ImgurComAlbum"
+ __type__ = "crypter"
+ __version__ = "0.4"
+
+ __pattern__ = r'https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}'
+
+ __description__ = """Imgur.com decrypter plugin"""
+ __author_name_ = "nath_schwarz"
+ __author_mail_ = "nathan.notwhite@gmail.com"
+
+ TITLE_PATTERN = r'(?P<title>.+) - Imgur'
+ LINK_PATTERN = r'i\.imgur\.com/\w{7}s?\.(?:jpeg|jpg|png|gif|apng)'
+
+
+ def getLinks(self):
+ f = lambda url: "http://" + re.sub(r'(\w{7})s\.', r'\1.', url)
+ return uniqify(map(f, re.findall(self.LINK_PATTERN, self.html)))
diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py
index 8e994984b..0297d2007 100644
--- a/module/plugins/crypter/LetitbitNetFolder.py
+++ b/module/plugins/crypter/LetitbitNetFolder.py
@@ -7,8 +7,10 @@ from module.plugins.Crypter import Crypter
class LetitbitNetFolder(Crypter):
__name__ = "LetitbitNetFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?letitbit.net/folder/\w+'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?letitbit.net/folder/\w+'
+
__description__ = """Letitbit.net folder decrypter plugin"""
__author_name__ = ("DHMH", "z00nx")
__author_mail__ = ("webmaster@pcProfil.de", "z00nx0@gmail.com")
@@ -16,18 +18,15 @@ class LetitbitNetFolder(Crypter):
FOLDER_PATTERN = r'<table>(.*)</table>'
LINK_PATTERN = r'<a href="([^"]+)" target="_blank">'
+
def decrypt(self, pyfile):
html = self.load(pyfile.url)
- new_links = []
-
folder = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
if folder is None:
self.fail("Parse error (FOLDER)")
- new_links.extend(re.findall(self.LINK_PATTERN, folder.group(0)))
+ self.urls.extend(re.findall(self.LINK_PATTERN, folder.group(0)))
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ if not self.urls:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index 85dde6c87..060a434d2 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -1,10 +1,7 @@
# -*- coding: utf-8 -*-
-
#
-# v2.01 - hagg
# * cnl2 and web links are skipped if JS is not available (instead of failing the package)
# * only best available link source is used (priority: cnl2>rsdf>ccf>dlc>web
-#
import base64
import binascii
@@ -18,8 +15,10 @@ from module.unescape import unescape
class LinkSaveIn(Crypter):
__name__ = "LinkSaveIn"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$'
__version__ = "2.01"
+
+ __pattern__ = r'http://(?:www\.)?linksave.in/(?P<id>\w+)$'
+
__description__ = """LinkSave.in decrypter plugin"""
__author_name__ = "fragonib"
__author_mail__ = "fragonib[AT]yahoo[DOT]es"
@@ -27,21 +26,21 @@ class LinkSaveIn(Crypter):
# Constants
_JK_KEY_ = "jk"
_CRYPTED_KEY_ = "crypted"
- HOSTER_DOMAIN = "linksave.in"
+ HOSTER_NAME = "linksave.in"
+
def setup(self):
self.html = None
self.fileid = None
self.captcha = False
self.package = None
- self.preferred_sources = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web']
+ self.preferred_sources = ["cnl2", "rsdf", "ccf", "dlc", "web"]
def decrypt(self, pyfile):
-
# Init
self.package = pyfile.package()
self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
- self.req.cj.setCookie(self.HOSTER_DOMAIN, "Linksave_Language", "english")
+ self.req.cj.setCookie(self.HOSTER_NAME, "Linksave_Language", "english")
# Request package
self.html = self.load(pyfile.url)
@@ -124,11 +123,11 @@ class LinkSaveIn(Crypter):
self.correctCaptcha()
def handleLinkSource(self, type_):
- if type_ == 'cnl2':
+ if type_ == "cnl2":
return self.handleCNL2()
- elif type_ in ('rsdf', 'ccf', 'dlc'):
+ elif type_ in ("rsdf", "ccf", "dlc"):
return self.handleContainer(type_)
- elif type_ == 'web':
+ elif type_ == "web":
return self.handleWebLinks()
else:
self.fail('unknown source type "%s" (this is probably a bug)' % type_)
@@ -189,7 +188,6 @@ class LinkSaveIn(Crypter):
return package_links
def _getCipherParams(self):
-
# Get jk
jk_re = r'<INPUT.*?NAME="%s".*?VALUE="(.*?)"' % LinkSaveIn._JK_KEY_
vjk = re.findall(jk_re, self.html)
@@ -203,7 +201,6 @@ class LinkSaveIn(Crypter):
return vcrypted, vjk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py
index a6e6faa40..21f05b962 100644
--- a/module/plugins/crypter/LinkdecrypterCom.py
+++ b/module/plugins/crypter/LinkdecrypterCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Crypter import Crypter
@@ -25,6 +8,9 @@ class LinkdecrypterCom(Crypter):
__name__ = "LinkdecrypterCom"
__type__ = "crypter"
__version__ = "0.27"
+
+ __pattern__ = None
+
__description__ = """Linkdecrypter.com"""
__author_name__ = ("zoidberg", "flowlee")
__author_mail__ = ("zoidberg@mujmail.cz", "")
@@ -34,15 +20,14 @@ class LinkdecrypterCom(Crypter):
CAPTCHA_PATTERN = r'<img class="captcha" src="(.+?)"(.*?)>'
REDIR_PATTERN = r'<i>(Click <a href="./">here</a> if your browser does not redirect you).</i>'
+
def decrypt(self, pyfile):
self.passwords = self.getPassword().splitlines()
# API not working anymore
- new_links = self.decryptHTML()
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ self.urls = self.decryptHTML()
+ if not self.urls:
self.fail('Could not extract any links')
def decryptAPI(self):
@@ -72,17 +57,17 @@ class LinkdecrypterCom(Crypter):
self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True)
while self.passwords or retries:
- found = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL)
- if found:
- return [x for x in found.group(1).splitlines() if '[LINK-ERROR]' not in x]
+ m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL)
+ if m:
+ return [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x]
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if found:
- captcha_url = 'http://linkdecrypter.com/' + found.group(1)
- result_type = "positional" if "getPos" in found.group(2) else "textual"
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m:
+ captcha_url = 'http://linkdecrypter.com/' + m.group(1)
+ result_type = "positional" if "getPos" in m.group(2) else "textual"
- found = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html)
- msg = found.group(1) if found else ""
+ m = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html)
+ msg = m.group(1) if m else ""
self.logInfo("Captcha protected link", result_type, msg)
captcha = self.decryptCaptcha(captcha_url, result_type=result_type)
diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py
index 619a474f2..cdf87eeb2 100644
--- a/module/plugins/crypter/LixIn.py
+++ b/module/plugins/crypter/LixIn.py
@@ -8,39 +8,42 @@ from module.plugins.Crypter import Crypter
class LixIn(Crypter):
__name__ = "LixIn"
__type__ = "crypter"
- __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)'
__version__ = "0.22"
+
+ __pattern__ = r'http://(www.)?lix.in/(?P<id>.*)'
+
__description__ = """Lix.in decrypter plugin"""
__author_name__ = "spoob"
__author_mail__ = "spoob@pyload.org"
- CAPTCHA_PATTERN = '<img src="(?P<image>captcha_img.php\?.*?)"'
+ CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img.php\?.*?)"'
SUBMIT_PATTERN = r"value='continue.*?'"
LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"'
+
def decrypt(self, pyfile):
url = pyfile.url
- matches = re.match(self.__pattern__, url)
- if not matches:
+ m = re.match(self.__pattern__, url)
+ if m is None:
self.fail("couldn't identify file id")
- id = matches.group("id")
+ id = m.group("id")
self.logDebug("File id is %s" % id)
self.html = self.req.load(url, decode=True)
- matches = re.search(self.SUBMIT_PATTERN, self.html)
- if not matches:
+ m = re.search(self.SUBMIT_PATTERN, self.html)
+ if m is None:
self.fail("link doesn't seem valid")
- matches = re.search(self.CAPTCHA_PATTERN, self.html)
- if matches:
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m:
for _ in xrange(5):
- matches = re.search(self.CAPTCHA_PATTERN, self.html)
- if matches:
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m:
self.logDebug("trying captcha")
- captcharesult = self.decryptCaptcha("http://lix.in/" + matches.group("image"))
+ captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image"))
self.html = self.req.load(url, decode=True,
post={"capt": captcharesult, "submit": "submit", "tiny": id})
else:
@@ -48,11 +51,9 @@ class LixIn(Crypter):
else:
self.html = self.req.load(url, decode=True, post={"submit": "submit", "tiny": id})
- matches = re.search(self.LINK_PATTERN, self.html)
- if not matches:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.fail("can't find destination url")
-
- new_link = matches.group("link")
- self.logDebug("Found link %s, adding to package" % new_link)
-
- self.packages.append((pyfile.package().name, [new_link], pyfile.package().name))
+ else:
+ self.urls = [m.group("link")]
+ self.logDebug("Found link %s, adding to package" % self.urls[0])
diff --git a/module/plugins/crypter/LofCc.py b/module/plugins/crypter/LofCc.py
index a17d58884..8a5cd86ee 100644
--- a/module/plugins/crypter/LofCc.py
+++ b/module/plugins/crypter/LofCc.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class LofCc(DeadCrypter):
__name__ = "LofCc"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?lof.cc/(.*)'
__version__ = "0.21"
+
+ __pattern__ = r'http://(?:www\.)?lof.cc/(.*)'
+
__description__ = """Lof.cc decrypter plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
diff --git a/module/plugins/crypter/MBLinkInfo.py b/module/plugins/crypter/MBLinkInfo.py
index 8aa70e8ff..4fc066e57 100644
--- a/module/plugins/crypter/MBLinkInfo.py
+++ b/module/plugins/crypter/MBLinkInfo.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class MBLinkInfo(DeadCrypter):
__name__ = "MBLinkInfo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?mblink\.info/?\?id=(\d+)'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?mblink\.info/?\?id=(\d+)'
+
__description__ = """MBLink.info decrypter plugin"""
__author_name__ = ("Gummibaer", "stickell")
__author_mail__ = ("Gummibaer@wiki-bierkiste.de", "l.stickell@yahoo.it")
diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py
index 46856229c..bb7c90722 100644
--- a/module/plugins/crypter/MediafireComFolder.py
+++ b/module/plugins/crypter/MediafireComFolder.py
@@ -9,33 +9,34 @@ from module.common.json_layer import json_loads
class MediafireComFolder(Crypter):
__name__ = "MediafireComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?mediafire\.com/(folder/|\?sharekey=|\?\w{13}($|[/#]))'
__version__ = "0.14"
+
+ __pattern__ = r'http://(?:www\.)?mediafire\.com/(folder/|\?sharekey=|\?\w{13}($|[/#]))'
+
__description__ = """Mediafire.com folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FOLDER_KEY_PATTERN = r"var afI= '(\w+)';"
- FILE_URL_PATTERN = '<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>'
+ FILE_URL_PATTERN = r'<meta property="og:url" content="http://www.mediafire.com/\?(\w+)"/>'
- def decrypt(self, pyfile):
- new_links = []
+ def decrypt(self, pyfile):
url, result = checkHTMLHeader(pyfile.url)
self.logDebug('Location (%d): %s' % (result, url))
if result == 0:
- # load and parse html
+ # load and parse html
html = self.load(pyfile.url)
- found = re.search(self.FILE_URL_PATTERN, html)
- if found:
+ m = re.search(self.FILE_URL_PATTERN, html)
+ if m:
# file page
- new_links.append("http://www.mediafire.com/file/%s" % found.group(1))
+ self.urls.append("http://www.mediafire.com/file/%s" % m.group(1))
else:
# folder page
- found = re.search(self.FOLDER_KEY_PATTERN, html)
- if found:
- folder_key = found.group(1)
+ m = re.search(self.FOLDER_KEY_PATTERN, html)
+ if m:
+ folder_key = m.group(1)
self.logDebug("FOLDER KEY: %s" % folder_key)
json_resp = json_loads(self.load(
@@ -43,15 +44,13 @@ class MediafireComFolder(Crypter):
#self.logInfo(json_resp)
if json_resp['response']['result'] == "Success":
for link in json_resp['response']['folder_info']['files']:
- new_links.append("http://www.mediafire.com/file/%s" % link['quickkey'])
+ self.urls.append("http://www.mediafire.com/file/%s" % link['quickkey'])
else:
self.fail(json_resp['response']['message'])
elif result == 1:
self.offline()
else:
- new_links.append(url)
+ self.urls.append(url)
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ if not self.urls:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/Movie2kTo.py b/module/plugins/crypter/Movie2kTo.py
index 991e1e1ee..ba201621f 100644
--- a/module/plugins/crypter/Movie2kTo.py
+++ b/module/plugins/crypter/Movie2kTo.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class Movie2kTo(DeadCrypter):
__name__ = "Movie2kTo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html'
__version__ = "0.51"
+
+ __pattern__ = r'http://(?:www\.)?movie2k\.to/(.*)\.html'
+
__description__ = """Movie2k.to decrypter plugin"""
__author_name__ = "4Christopher"
__author_mail__ = "4Christopher@gmx.de"
diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py
index 997d60862..ffeaa6f04 100644
--- a/module/plugins/crypter/MultiUpOrg.py
+++ b/module/plugins/crypter/MultiUpOrg.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
-
import re
from urlparse import urljoin
@@ -26,14 +9,17 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class MultiUpOrg(SimpleCrypter):
__name__ = "MultiUpOrg"
__type__ = "crypter"
- __pattern__ = r"http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?"
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?'
+
__description__ = """MultiUp.org crypter plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
TITLE_PATTERN = r'<title>.*(Project|Projet|ownload|élécharger) (?P<title>.+?) (\(|- )'
+
def getLinks(self):
m_type = re.match(self.__pattern__, self.pyfile.url).group("TYPE")
diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py
index 5e7051bad..7d43ec729 100644
--- a/module/plugins/crypter/MultiloadCz.py
+++ b/module/plugins/crypter/MultiloadCz.py
@@ -7,36 +7,36 @@ from module.plugins.Crypter import Crypter
class MultiloadCz(Crypter):
__name__ = "MultiloadCz"
__type__ = "crypter"
- __pattern__ = r'http://(?:[^/]*\.)?multiload.cz/(stahnout|slozka)/.*'
__version__ = "0.4"
- __description__ = """Multiload.cz decrypter plugin"""
+
+ __pattern__ = r'http://(?:[^/]*\.)?multiload.cz/(stahnout|slozka)/.*'
__config__ = [("usedHoster", "str", "Prefered hoster list (bar-separated) ", ""),
("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")]
+
+ __description__ = """Multiload.cz decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FOLDER_PATTERN = r'<form action="" method="get"><textarea[^>]*>([^>]*)</textarea></form>'
LINK_PATTERN = r'<p class="manager-server"><strong>([^<]+)</strong></p><p class="manager-linky"><a href="([^"]+)">'
+
def decrypt(self, pyfile):
self.html = self.load(pyfile.url, decode=True)
- new_links = []
if re.match(self.__pattern__, pyfile.url).group(1) == "slozka":
- found = re.search(self.FOLDER_PATTERN, self.html)
- if found is not None:
- new_links.extend(found.group(1).split())
+ m = re.search(self.FOLDER_PATTERN, self.html)
+ if m:
+ self.urls.extend(m.group(1).split())
else:
- found = re.findall(self.LINK_PATTERN, self.html)
- if found:
+ m = re.findall(self.LINK_PATTERN, self.html)
+ if m:
prefered_set = set(self.getConfig("usedHoster").split('|'))
- new_links.extend([x[1] for x in found if x[0] in prefered_set])
+ self.urls.extend([x[1] for x in m if x[0] in prefered_set])
- if not new_links:
+ if not self.urls:
ignored_set = set(self.getConfig("ignoredHoster").split('|'))
- new_links.extend([x[1] for x in found if x[0] not in ignored_set])
+ self.urls.extend([x[1] for x in m if x[0] not in ignored_set])
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ if not self.urls:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/MultiuploadCom.py b/module/plugins/crypter/MultiuploadCom.py
index 677080772..96cd734e4 100644
--- a/module/plugins/crypter/MultiuploadCom.py
+++ b/module/plugins/crypter/MultiuploadCom.py
@@ -10,53 +10,53 @@ from module.common.json_layer import json_loads
class MultiuploadCom(Crypter):
__name__ = "MultiuploadCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?multiupload.com/(\w+)'
__version__ = "0.01"
- __description__ = """MultiUpload.com decrypter plugin"""
+
+ __pattern__ = r'http://(?:www\.)?multiupload.com/(\w+)'
__config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "multiupload"),
("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")]
+
+ __description__ = """MultiUpload.com decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
ML_LINK_PATTERN = r'<div id="downloadbutton_" style=""><a href="([^"]+)"'
+
def decrypt(self, pyfile):
self.html = self.load(pyfile.url)
- found = re.search(self.ML_LINK_PATTERN, self.html)
- ml_url = found.group(1) if found else None
+ m = re.search(self.ML_LINK_PATTERN, self.html)
+ ml_url = m.group(1) if m else None
json_list = json_loads(self.load("http://multiupload.com/progress/", get={
"d": re.match(self.__pattern__, pyfile.url).group(1),
"r": str(int(time() * 1000))
}))
- new_links = []
prefered_set = map(lambda s: s.lower().split('.')[0], set(self.getConfig("preferedHoster").split('|')))
if ml_url and 'multiupload' in prefered_set:
- new_links.append(ml_url)
+ self.urls.append(ml_url)
for link in json_list:
if link['service'].lower() in prefered_set and int(link['status']) and not int(link['deleted']):
url = self.getLocation(link['url'])
if url:
- new_links.append(url)
+ self.urls.append(url)
- if not new_links:
+ if not self.urls:
ignored_set = map(lambda s: s.lower().split('.')[0], set(self.getConfig("ignoredHoster").split('|')))
if 'multiupload' not in ignored_set:
- new_links.append(ml_url)
+ self.urls.append(ml_url)
for link in json_list:
if link['service'].lower() not in ignored_set and int(link['status']) and not int(link['deleted']):
url = self.getLocation(link['url'])
if url:
- new_links.append(url)
+ self.urls.append(url)
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ if not self.urls:
self.fail('Could not extract any links')
def getLocation(self, url):
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index eacd4aa8d..1b7b8b3d4 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -5,6 +5,7 @@ import binascii
import re
from Crypto.Cipher import AES
+
from module.plugins.Crypter import Crypter
from module.plugins.internal.CaptchaService import ReCaptcha
@@ -12,27 +13,28 @@ from module.plugins.internal.CaptchaService import ReCaptcha
class NCryptIn(Crypter):
__name__ = "NCryptIn"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?ncrypt.in/(?P<type>folder|link|frame)-([^/\?]+)'
__version__ = "1.32"
+
+ __pattern__ = r'http://(?:www\.)?ncrypt.in/(?P<type>folder|link|frame)-([^/\?]+)'
+
__description__ = """NCrypt.in decrypter plugin"""
__author_name__ = ("fragonib", "stickell")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es", "l.stickell@yahoo.it")
- # Constants
- _JK_KEY_ = "jk"
- _CRYPTED_KEY_ = "crypted"
+ JK_KEY = "jk"
+ CRYPTED_KEY = "crypted"
NAME_PATTERN = r'<meta name="description" content="(?P<N>[^"]+)"'
+
def setup(self):
self.package = None
self.html = None
self.cleanedHtml = None
- self.links_source_order = ['cnl2', 'rsdf', 'ccf', 'dlc', 'web']
+ self.links_source_order = ["cnl2", "rsdf", "ccf", "dlc", "web"]
self.protection_type = None
def decrypt(self, pyfile):
-
# Init
self.package = pyfile.package()
package_links = []
@@ -52,7 +54,7 @@ class NCryptIn(Crypter):
if not self.isOnline():
self.offline()
- # Check for folder protection
+ # Check for folder protection
if self.isProtected():
self.html = self.unlockProtection()
self.cleanedHtml = self.removeHtmlCrap(self.html)
@@ -75,7 +77,7 @@ class NCryptIn(Crypter):
def isSingleLink(self):
link_type = re.match(self.__pattern__, self.pyfile.url).group('type')
- return link_type in ('link', 'frame')
+ return link_type in ("link", "frame")
def requestFolderHome(self):
return self.load(self.pyfile.url, decode=True)
@@ -93,16 +95,16 @@ class NCryptIn(Crypter):
def isOnline(self):
if "Your folder does not exist" in self.cleanedHtml:
- self.logDebug("File not found")
+ self.logDebug("File not m")
return False
return True
def isProtected(self):
- form_match = re.search(r'<form.*?name.*?protected.*?>(.*?)</form>', self.cleanedHtml, re.DOTALL)
- if form_match:
- form_content = form_match.group(1)
+ form = re.search(r'<form.*?name.*?protected.*?>(.*?)</form>', self.cleanedHtml, re.DOTALL)
+ if form is not None:
+ content = form.group(1)
for keyword in ("password", "captcha"):
- if keyword in form_content:
+ if keyword in content:
self.protection_type = keyword
self.logDebug("Links are %s protected" % self.protection_type)
return True
@@ -116,7 +118,7 @@ class NCryptIn(Crypter):
else:
name = self.package.name
folder = self.package.folder
- self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
+ self.logDebug("Package info not m, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
return name, folder
def unlockProtection(self):
@@ -139,7 +141,7 @@ class NCryptIn(Crypter):
self.logDebug("Captcha resolved [%s]" % captcha)
postData['captcha'] = captcha
- # Resolve recaptcha
+ # Resolve recaptcha
if "recaptcha" in form:
self.logDebug("ReCaptcha protected")
captcha_key = re.search(r'\?k=(.*?)"', form).group(1)
@@ -163,7 +165,6 @@ class NCryptIn(Crypter):
return self.load(self.pyfile.url, post=postData, decode=True)
def handleErrors(self):
-
if self.protection_type == "password":
if "This password is invalid!" in self.cleanedHtml:
self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry")
@@ -178,9 +179,8 @@ class NCryptIn(Crypter):
self.correctCaptcha()
def handleLinkSource(self, link_source_type):
-
# Check for JS engine
- require_js_engine = link_source_type in ('cnl2', 'rsdf', 'ccf', 'dlc')
+ require_js_engine = link_source_type in ("cnl2", "rsdf", "ccf", "dlc")
if require_js_engine and not self.js:
self.logDebug("No JS engine available, skip %s links" % link_source_type)
return []
@@ -190,9 +190,9 @@ class NCryptIn(Crypter):
return self.handleSingleLink()
if link_source_type == 'cnl2':
return self.handleCNL2()
- elif link_source_type in ('rsdf', 'ccf', 'dlc'):
+ elif link_source_type in ("rsdf", "ccf", "dlc"):
return self.handleContainer(link_source_type)
- elif link_source_type == 'web':
+ elif link_source_type == "web":
return self.handleWebLinks()
else:
self.fail('unknown source type "%s" (this is probably a bug)' % link_source_type)
@@ -267,11 +267,11 @@ class NCryptIn(Crypter):
pattern = r'<input.*?name="%s".*?value="(.*?)"'
# Get jk
- jk_re = pattern % NCryptIn._JK_KEY_
+ jk_re = pattern % NCryptIn.JK_KEY
vjk = re.findall(jk_re, self.html)
# Get crypted
- crypted_re = pattern % NCryptIn._CRYPTED_KEY_
+ crypted_re = pattern % NCryptIn.CRYPTED_KEY
vcrypted = re.findall(crypted_re, self.html)
# Log and return
@@ -279,7 +279,6 @@ class NCryptIn(Crypter):
return vcrypted, vjk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py
index 28ee3a9dd..1c337391c 100644
--- a/module/plugins/crypter/NetfolderIn.py
+++ b/module/plugins/crypter/NetfolderIn.py
@@ -8,22 +8,25 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class NetfolderIn(SimpleCrypter):
__name__ = "NetfolderIn"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))'
__version__ = "0.6"
+
+ __pattern__ = r'http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\w+))'
+
__description__ = """NetFolder.in decrypter plugin"""
__author_name__ = ("RaNaN", "fragonib")
__author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es")
TITLE_PATTERN = r'<div class="Text">Inhalt des Ordners <span(.*)>(?P<title>.+)</span></div>'
+
def decrypt(self, pyfile):
# Request package
self.html = self.load(pyfile.url)
- # Check for password protection
+ # Check for password protection
if self.isPasswordProtected():
self.html = self.submitPassword()
- if self.html is None:
+ if not self.html:
self.fail("Incorrect password, please set right password on Add package form and retry")
# Get package name and folder
@@ -36,7 +39,6 @@ class NetfolderIn(SimpleCrypter):
self.packages = [(package_name, package_links, folder_name)]
def isPasswordProtected(self):
-
if '<input type="password" name="password"' in self.html:
self.logDebug("Links are password protected")
return True
@@ -53,7 +55,7 @@ class NetfolderIn(SimpleCrypter):
url = "http://netfolder.in/folder.php?folder_id=" + id
password = self.getPassword()
- # Submit package password
+ # Submit package password
post = {'password': password, 'save': 'Absenden'}
self.logDebug("Submitting password [%s] for protected links with id [%s]" % (password, id))
html = self.load(url, {}, post)
diff --git a/module/plugins/crypter/NosvideoCom.py b/module/plugins/crypter/NosvideoCom.py
index 63e199a7a..a3bb11b16 100644
--- a/module/plugins/crypter/NosvideoCom.py
+++ b/module/plugins/crypter/NosvideoCom.py
@@ -6,11 +6,13 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class NosvideoCom(SimpleCrypter):
__name__ = "NosvideoCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?nosvideo\.com/\?v=\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?nosvideo\.com/\?v=\w+'
+
__description__ = """Nosvideo.com decrypter plugin"""
__author_name__ = "igel"
__author_mail__ = "igelkun@myopera.com"
LINK_PATTERN = r'href="(http://(?:w{3}\.)?nosupload.com/\?d=\w+)"'
- TITLE_PATTERN = r"<[tT]itle>Watch (?P<title>.+)</[tT]itle>"
+ TITLE_PATTERN = r'<[tT]itle>Watch (?P<title>.+)</[tT]itle>'
diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py
index 82fad86ce..ba93278d5 100644
--- a/module/plugins/crypter/OneKhDe.py
+++ b/module/plugins/crypter/OneKhDe.py
@@ -9,12 +9,15 @@ from module.plugins.Crypter import Crypter
class OneKhDe(Crypter):
__name__ = "OneKhDe"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?1kh.de/f/'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?1kh.de/f/'
+
__description__ = """1kh.de decrypter plugin"""
__author_name__ = "spoob"
__author_mail__ = "spoob@pyload.org"
+
def __init__(self, parent):
Crypter.__init__(self, parent)
self.parent = parent
@@ -28,10 +31,8 @@ class OneKhDe(Crypter):
def proceed(self, url, location):
url = self.parent.url
self.html = self.req.load(url)
- temp_links = []
link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html)
for id in link_ids:
new_link = unescape(
re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1))
- temp_links.append(new_link)
- self.links = temp_links
+ self.urls.append(new_link)
diff --git a/module/plugins/crypter/OronComFolder.py b/module/plugins/crypter/OronComFolder.py
index f087370ac..f0b2f943c 100755
--- a/module/plugins/crypter/OronComFolder.py
+++ b/module/plugins/crypter/OronComFolder.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class OronComFolder(DeadCrypter):
__name__ = "OronComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?oron.com/folder/\w+'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?oron.com/folder/\w+'
+
__description__ = """Oron.com folder decrypter plugin"""
__author_name__ = "DHMH"
__author_mail__ = "webmaster@pcProfil.de"
diff --git a/module/plugins/crypter/PastebinCom.py b/module/plugins/crypter/PastebinCom.py
index e74f71a5c..55aa2ee4a 100644
--- a/module/plugins/crypter/PastebinCom.py
+++ b/module/plugins/crypter/PastebinCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.SimpleCrypter import SimpleCrypter
@@ -20,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class PastebinCom(SimpleCrypter):
__name__ = "PastebinCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?pastebin\.com/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?pastebin\.com/\w+'
+
__description__ = """Pastebin.com decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py
index 13d7671bf..9840b84df 100644
--- a/module/plugins/crypter/QuickshareCzFolder.py
+++ b/module/plugins/crypter/QuickshareCzFolder.py
@@ -7,8 +7,10 @@ from module.plugins.Crypter import Crypter
class QuickshareCzFolder(Crypter):
__name__ = "QuickshareCzFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?quickshare.cz/slozka-\d+.*'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?quickshare.cz/slozka-\d+.*'
+
__description__ = """Quickshare.cz folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -16,16 +18,14 @@ class QuickshareCzFolder(Crypter):
FOLDER_PATTERN = r'<textarea[^>]*>(.*?)</textarea>'
LINK_PATTERN = r'(http://www.quickshare.cz/\S+)'
+
def decrypt(self, pyfile):
html = self.load(pyfile.url)
- new_links = []
- found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None:
+ m = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
+ if m is None:
self.fail("Parse error (FOLDER)")
- new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))
+ self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1)))
- if new_links:
- self.core.files.addLinks(new_links, pyfile.package().id)
- else:
+ if not self.urls:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/RSLayerCom.py b/module/plugins/crypter/RSLayerCom.py
index 9f1a9a394..7dda0beab 100644
--- a/module/plugins/crypter/RSLayerCom.py
+++ b/module/plugins/crypter/RSLayerCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class RSLayerCom(DeadCrypter):
__name__ = "RSLayerCom"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?rs-layer.com/directory-'
__version__ = "0.21"
+
+ __pattern__ = r'http://(?:www\.)?rs-layer.com/directory-'
+
__description__ = """RS-Layer.com decrypter plugin"""
__author_name__ = "hzpz"
- __author_mail__ = ""
+ __author_mail__ = None
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index aad55c867..1b120fc77 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -12,36 +12,39 @@ from module.plugins.Crypter import Crypter
class RelinkUs(Crypter):
__name__ = "RelinkUs"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)'
__version__ = "3.0"
+
+ __pattern__ = r'http://(?:www\.)?relink.us/(f/|((view|go).php\?id=))(?P<id>.+)'
+
__description__ = """Relink.us decrypter plugin"""
__author_name__ = "fragonib"
__author_mail__ = "fragonib[AT]yahoo[DOT]es"
# Constants
- PREFERRED_LINK_SOURCES = ['cnl2', 'dlc', 'web']
-
- OFFLINE_TOKEN = "<title>Tattooside"
- PASSWORD_TOKEN = "container_password.php"
- PASSWORD_ERROR_ROKEN = "You have entered an incorrect password"
- PASSWORD_SUBMIT_URL = "http://www.relink.us/container_password.php"
- CAPTCHA_TOKEN = "container_captcha.php"
- CAPTCHA_ERROR_ROKEN = "You have solved the captcha wrong"
- CAPTCHA_IMG_URL = "http://www.relink.us/core/captcha/circlecaptcha.php"
- CAPTCHA_SUBMIT_URL = "http://www.relink.us/container_captcha.php"
- FILE_TITLE_REGEX = r"<th>Title</th><td><i>(.*)</i></td></tr>"
- FILE_NOTITLE = 'No title'
+ PREFERRED_LINK_SOURCES = ["cnl2", "dlc", "web"]
+
+ OFFLINE_TOKEN = r'<title>Tattooside'
+ PASSWORD_TOKEN = r'container_password\.php'
+ PASSWORD_ERROR_ROKEN = r'You have entered an incorrect password'
+ PASSWORD_SUBMIT_URL = r'http://www\.relink\.us/container_password\.php'
+ CAPTCHA_TOKEN = r'container_captcha\.php'
+ CAPTCHA_ERROR_ROKEN = r'You have solved the captcha wrong'
+ CAPTCHA_IMG_URL = r'http://www\.relink\.us/core/captcha/circlecaptcha\.php'
+ CAPTCHA_SUBMIT_URL = r'http://www\.relink\.us/container_captcha\.php'
+ FILE_TITLE_REGEX = r'<th>Title</th><td><i>(.*)</i></td></tr>'
+ FILE_NOTITLE = r'No title'
CNL2_FORM_REGEX = r'<form id="cnl_form-(.*?)</form>'
CNL2_FORMINPUT_REGEX = r'<input.*?name="%s".*?value="(.*?)"'
CNL2_JK_KEY = "jk"
CNL2_CRYPTED_KEY = "crypted"
DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">'
- DLC_DOWNLOAD_URL = "http://www.relink.us/download.php"
+ DLC_DOWNLOAD_URL = r'http://www\.relink\.us/download\.php'
WEB_FORWARD_REGEX = r"getFile\('(?P<link>.+)'\)"
- WEB_FORWARD_URL = "http://www.relink.us/frame.php"
+ WEB_FORWARD_URL = r'http://www\.relink\.us/frame\.php'
WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>'
+
def setup(self):
self.fileid = None
self.package = None
@@ -50,7 +53,6 @@ class RelinkUs(Crypter):
self.captcha = False
def decrypt(self, pyfile):
-
# Init
self.initPackage(pyfile)
@@ -61,7 +63,7 @@ class RelinkUs(Crypter):
if not self.isOnline():
self.offline()
- # Check for protection
+ # Check for protection
if self.isPasswordProtected():
self.unlockPasswordProtection()
self.handleErrors()
@@ -92,10 +94,9 @@ class RelinkUs(Crypter):
self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
self.package = pyfile.package()
self.password = self.getPassword()
- self.url = pyfile.url
def requestPackage(self):
- self.html = self.load(self.url, decode=True)
+ self.html = self.load(self.pyfile.url, decode=True)
def isOnline(self):
if self.OFFLINE_TOKEN in self.html:
@@ -132,7 +133,7 @@ class RelinkUs(Crypter):
def getPackageInfo(self):
name = folder = None
- # Try to get info from web
+ # Try to get info from web
m = re.search(self.FILE_TITLE_REGEX, self.html)
if m is not None:
title = m.group(1).strip()
@@ -146,7 +147,7 @@ class RelinkUs(Crypter):
folder = self.package.folder
self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
- # Return package info
+ # Return package info
return name, folder
def handleErrors(self):
@@ -197,7 +198,7 @@ class RelinkUs(Crypter):
try:
dlc = self.load(container_url)
dlc_filename = self.fileid + ".dlc"
- dlc_filepath = os.path.join(self.config["general"]["download_folder"], dlc_filename)
+ dlc_filepath = os.path.join(self.config['general']['download_folder'], dlc_filename)
f = open(dlc_filepath, "wb")
f.write(dlc)
f.close()
@@ -225,7 +226,6 @@ class RelinkUs(Crypter):
return package_links
def _getCipherParams(self, cnl2_form):
-
# Get jk
jk_re = self.CNL2_FORMINPUT_REGEX % self.CNL2_JK_KEY
vjk = re.findall(jk_re, cnl2_form, re.IGNORECASE)
@@ -239,7 +239,6 @@ class RelinkUs(Crypter):
return vcrypted, vjk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py
index 4a907c28d..e0c165705 100644
--- a/module/plugins/crypter/SafelinkingNet.py
+++ b/module/plugins/crypter/SafelinkingNet.py
@@ -1,24 +1,29 @@
# -*- coding: utf-8 -*-
import re
+
from pycurl import FOLLOWLOCATION
+from module.lib.BeautifulSoup import BeautifulSoup
+
from module.common.json_layer import json_loads
from module.plugins.Crypter import Crypter
from module.plugins.internal.CaptchaService import SolveMedia
-from module.lib.BeautifulSoup import BeautifulSoup
class SafelinkingNet(Crypter):
- __name__ = 'SafelinkingNet'
- __type__ = 'crypter'
+ __name__ = "SafelinkingNet"
+ __type__ = "crypter"
+ __version__ = "0.1"
+
__pattern__ = r'https?://(?:www\.)?safelinking.net/([pd])/\w+'
- __version__ = '0.1'
+
__description__ = """Safelinking.net decrypter plugin"""
__author_name__ = "quareevo"
__author_mail__ = "quareevo@arcor.de"
- __Solvemedia_pattern__ = "solvemediaApiKey = '([\w\.\-_]+)';"
+ SOLVEMEDIA_PATTERN = "solvemediaApiKey = '([\w\.\-_]+)';"
+
def decrypt(self, pyfile):
url = pyfile.url
@@ -27,24 +32,23 @@ class SafelinkingNet(Crypter):
self.load(url)
m = re.search("^Location: (.+)$", self.req.http.header, re.MULTILINE)
if m:
- self.core.files.addLinks([m.group(1)], pyfile.package().id)
+ self.urls = [m.group(1)]
else:
self.fail("Couldn't find forwarded Link")
else:
password = ""
- packageLinks = []
postData = {"post-protect": "1"}
self.html = self.load(url)
if "link-password" in self.html:
password = pyfile.package().password
- postData["link-password"] = password
+ postData['link-password'] = password
if "altcaptcha" in self.html:
for _ in xrange(5):
- m = re.search(self.__Solvemedia_pattern__, self.html)
+ m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
if m:
captchaKey = m.group(1)
captcha = SolveMedia(self)
@@ -53,8 +57,8 @@ class SafelinkingNet(Crypter):
self.fail("Error parsing captcha")
challenge, response = captcha.challenge(captchaKey)
- postData["adcopy_challenge"] = challenge
- postData["adcopy_response"] = response
+ postData['adcopy_challenge'] = challenge
+ postData['adcopy_response'] = response
self.html = self.load(url, post=postData)
if "The password you entered was incorrect" in self.html:
@@ -72,9 +76,7 @@ class SafelinkingNet(Crypter):
if m:
linkDict = json_loads(m.group(1))
for link in linkDict:
- if not "http://" in link["full"]:
- packageLinks.append("https://safelinking.net/d/" + link["full"])
+ if not "http://" in link['full']:
+ self.urls.append("https://safelinking.net/d/" + link['full'])
else:
- packageLinks.append(link["full"])
-
- self.core.files.addLinks(packageLinks, pyfile.package().id)
+ self.urls.append(link['full'])
diff --git a/module/plugins/crypter/SecuredIn.py b/module/plugins/crypter/SecuredIn.py
index 771205ec8..0b558c688 100644
--- a/module/plugins/crypter/SecuredIn.py
+++ b/module/plugins/crypter/SecuredIn.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class SecuredIn(DeadCrypter):
__name__ = "SecuredIn"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?secured\.in/download-[\d]+-[\w]{8}\.html'
__version__ = "0.21"
+
+ __pattern__ = r'http://(?:www\.)?secured\.in/download-[\d]+-[\w]{8}\.html'
+
__description__ = """Secured.in decrypter plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
diff --git a/module/plugins/crypter/SerienjunkiesOrg.py b/module/plugins/crypter/SerienjunkiesOrg.py
index 6fbbfedb3..fe4ee4e36 100644
--- a/module/plugins/crypter/SerienjunkiesOrg.py
+++ b/module/plugins/crypter/SerienjunkiesOrg.py
@@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
+import random
import re
+
from time import sleep
-import random
-from module.plugins.Crypter import Crypter
+
from module.lib.BeautifulSoup import BeautifulSoup
+
+from module.plugins.Crypter import Crypter
from module.unescape import unescape
class SerienjunkiesOrg(Crypter):
__name__ = "SerienjunkiesOrg"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?(serienjunkies.org|dokujunkies.org)/.*?'
__version__ = "0.39"
+
+ __pattern__ = r'http://(?:www\.)?(serienjunkies.org|dokujunkies.org)/.*?'
__config__ = [("changeNameSJ", "Packagename;Show;Season;Format;Episode", "Take SJ.org name", "Show"),
("changeNameDJ", "Packagename;Show;Format;Episode", "Take DJ.org name", "Show"),
("randomPreferred", "bool", "Randomize Preferred-List", False),
@@ -21,10 +25,12 @@ class SerienjunkiesOrg(Crypter):
("hosterList", "str", "Preferred Hoster list (comma separated)",
"RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom,FreakshareNet,FilebaseTo,HotfileCom,DepositfilesCom,EasyshareCom,KickloadCom"),
("ignoreList", "str", "Ignored Hoster list (comma separated)", "MegauploadCom")]
+
__description__ = """Serienjunkies.org decrypter plugin"""
__author_name__ = ("mkaay", "godofdream")
__author_mail__ = ("mkaay@mkaay.de", "soilfiction@gmail.com")
+
def setup(self):
self.multiDL = False
@@ -51,9 +57,9 @@ class SerienjunkiesOrg(Crypter):
package_links = []
for a in nav.findAll("a"):
if self.getConfig("changeNameSJ") == "Show":
- package_links.append(a["href"])
+ package_links.append(a['href'])
else:
- package_links.append(a["href"] + "#hasName")
+ package_links.append(a['href'] + "#hasName")
if self.getConfig("changeNameSJ") == "Show":
self.packages.append((packageName, package_links, packageName))
else:
@@ -85,32 +91,32 @@ class SerienjunkiesOrg(Crypter):
opts[n.strip()] = val.strip()
gid += 1
groups[gid] = {}
- groups[gid]["ep"] = {}
- groups[gid]["opts"] = opts
+ groups[gid]['ep'] = {}
+ groups[gid]['opts'] = opts
elif re.search("<strong>Download:", str(p)):
parts = str(p).split("<br />")
if re.search("<strong>", parts[0]):
ename = re.search('<strong>(.*?)</strong>', parts[0]).group(1).strip().decode("utf-8").replace(
"&#8211;", "-")
- groups[gid]["ep"][ename] = {}
+ groups[gid]['ep'][ename] = {}
parts.remove(parts[0])
for part in parts:
hostername = re.search(r" \| ([-a-zA-Z0-9]+\.\w+)", part)
if hostername:
hostername = hostername.group(1)
- groups[gid]["ep"][ename][hostername] = []
+ groups[gid]['ep'][ename][hostername] = []
links = re.findall('href="(.*?)"', part)
for link in links:
- groups[gid]["ep"][ename][hostername].append(link + "#hasName")
+ groups[gid]['ep'][ename][hostername].append(link + "#hasName")
links = []
for g in groups.values():
- for ename in g["ep"]:
- links.extend(self.getpreferred(g["ep"][ename]))
+ for ename in g['ep']:
+ links.extend(self.getpreferred(g['ep'][ename]))
if self.getConfig("changeNameSJ") == "Episode":
self.packages.append((ename, links, ename))
links = []
- package = "%s (%s, %s)" % (seasonName, g["opts"]["Format"], g["opts"]["Sprache"])
+ package = "%s (%s, %s)" % (seasonName, g['opts']['Format'], g['opts']['Sprache'])
if self.getConfig("changeNameSJ") == "Format":
self.packages.append((package, links, package))
links = []
@@ -135,12 +141,12 @@ class SerienjunkiesOrg(Crypter):
sleep(5)
self.retry()
- captchaUrl = "http://download.serienjunkies.org" + captchaTag["src"]
+ captchaUrl = "http://download.serienjunkies.org" + captchaTag['src']
result = self.decryptCaptcha(str(captchaUrl), imgtype="png")
sinp = form.find(attrs={"name": "s"})
self.req.lastURL = str(url)
- sj = self.load(str(url), post={'s': sinp["value"], 'c': result, 'action': "Download"})
+ sj = self.load(str(url), post={'s': sinp['value'], 'c': result, 'action': "Download"})
soup = BeautifulSoup(sj)
rawLinks = soup.findAll(attrs={"action": re.compile("^http://download.serienjunkies.org/")})
@@ -154,7 +160,7 @@ class SerienjunkiesOrg(Crypter):
links = []
for link in rawLinks:
- frameUrl = link["action"].replace("/go-", "/frame/go-")
+ frameUrl = link['action'].replace("/go-", "/frame/go-")
links.append(self.handleFrame(frameUrl))
if re.search("#hasName", url) or ((self.getConfig("changeNameSJ") == "Packagename") and
(self.getConfig("changeNameDJ") == "Packagename")):
@@ -171,12 +177,12 @@ class SerienjunkiesOrg(Crypter):
soup = BeautifulSoup(sj)
form = soup.find("form", attrs={"action": re.compile("^http://serienjunkies.org")})
captchaTag = form.find(attrs={"src": re.compile("^/safe/secure/")})
- captchaUrl = "http://serienjunkies.org" + captchaTag["src"]
+ captchaUrl = "http://serienjunkies.org" + captchaTag['src']
result = self.decryptCaptcha(str(captchaUrl))
- url = form["action"]
+ url = form['action']
sinp = form.find(attrs={"name": "s"})
- self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'dl.start': "Download"}, cookies=False,
+ self.req.load(str(url), post={'s': sinp['value'], 'c': result, 'dl.start': "Download"}, cookies=False,
just_header=True)
decrypted = self.req.lastEffectiveURL
if decrypted == str(url):
@@ -215,32 +221,32 @@ class SerienjunkiesOrg(Crypter):
opts[n.strip()] = val.strip()
gid += 1
groups[gid] = {}
- groups[gid]["ep"] = {}
- groups[gid]["opts"] = opts
+ groups[gid]['ep'] = {}
+ groups[gid]['opts'] = opts
elif re.search("<strong>Download:", str(p)):
parts = str(p).split("<br />")
if re.search("<strong>", parts[0]):
ename = re.search('<strong>(.*?)</strong>', parts[0]).group(1).strip().decode("utf-8").replace(
"&#8211;", "-")
- groups[gid]["ep"][ename] = {}
+ groups[gid]['ep'][ename] = {}
parts.remove(parts[0])
for part in parts:
hostername = re.search(r" \| ([-a-zA-Z0-9]+\.\w+)", part)
if hostername:
hostername = hostername.group(1)
- groups[gid]["ep"][ename][hostername] = []
+ groups[gid]['ep'][ename][hostername] = []
links = re.findall('href="(.*?)"', part)
for link in links:
- groups[gid]["ep"][ename][hostername].append(link + "#hasName")
+ groups[gid]['ep'][ename][hostername].append(link + "#hasName")
links = []
for g in groups.values():
- for ename in g["ep"]:
- links.extend(self.getpreferred(g["ep"][ename]))
+ for ename in g['ep']:
+ links.extend(self.getpreferred(g['ep'][ename]))
if self.getConfig("changeNameDJ") == "Episode":
self.packages.append((ename, links, ename))
links = []
- package = "%s (%s, %s)" % (seasonName, g["opts"]["Format"], g["opts"]["Sprache"])
+ package = "%s (%s, %s)" % (seasonName, g['opts']['Format'], g['opts']['Sprache'])
if self.getConfig("changeNameDJ") == "Format":
self.packages.append((package, links, package))
links = []
@@ -255,7 +261,7 @@ class SerienjunkiesOrg(Crypter):
soup = BeautifulSoup(src)
content = soup.find("div", attrs={"id": "content"})
for a in content.findAll("a", attrs={"rel": "bookmark"}):
- package_links.append(a["href"])
+ package_links.append(a['href'])
self.core.files.addLinks(package_links, self.pyfile.package().id)
def decrypt(self, pyfile):
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index 816842216..87bb16a50 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -11,12 +11,15 @@ from module.plugins.Crypter import Crypter
class ShareLinksBiz(Crypter):
__name__ = "ShareLinksBiz"
__type__ = "crypter"
- __pattern__ = r'(?P<base>http://(?:www\.)?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?'
__version__ = "1.13"
+
+ __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P<ID>_?\w+)'
+
__description__ = """Share-Links.biz decrypter plugin"""
__author_name__ = "fragonib"
__author_mail__ = "fragonib[AT]yahoo[DOT]es"
+
def setup(self):
self.baseUrl = None
self.fileId = None
@@ -25,7 +28,6 @@ class ShareLinksBiz(Crypter):
self.captcha = False
def decrypt(self, pyfile):
-
# Init
self.initFile(pyfile)
@@ -63,8 +65,8 @@ class ShareLinksBiz(Crypter):
url = pyfile.url
if 's2l.biz' in url:
url = self.load(url, just_header=True)['location']
- self.baseUrl = re.match(self.__pattern__, url).group(1)
- self.fileId = re.match(self.__pattern__, url).group('id')
+ self.baseUrl = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1)
+ self.fileId = re.match(self.__pattern__, url).group('ID')
self.package = pyfile.package()
def isOnline(self):
@@ -223,7 +225,6 @@ class ShareLinksBiz(Crypter):
return package_links
def _getCipherParams(self):
-
# Request CNL2
code = re.search(r'ClicknLoad.swf\?code=(.*?)"', self.html).group(1)
url = "%s/get/cnl2/%s" % (self.baseUrl, code)
@@ -244,7 +245,6 @@ class ShareLinksBiz(Crypter):
return crypted, jk
def _getLinks(self, crypted, jk):
-
# Get key
jreturn = self.js.eval("%s f()" % jk)
self.logDebug("JsEngine returns value [%s]" % jreturn)
diff --git a/module/plugins/crypter/ShareRapidComFolder.py b/module/plugins/crypter/ShareRapidComFolder.py
index 15c8dccde..fd12ff96f 100644
--- a/module/plugins/crypter/ShareRapidComFolder.py
+++ b/module/plugins/crypter/ShareRapidComFolder.py
@@ -6,8 +6,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class ShareRapidComFolder(SimpleCrypter):
__name__ = "ShareRapidComFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(slozka/.+)'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(slozka/.+)'
+
__description__ = """Share-Rapid.com folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py
index 4bb1562ee..092d3efe4 100644
--- a/module/plugins/crypter/SpeedLoadOrgFolder.py
+++ b/module/plugins/crypter/SpeedLoadOrgFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.DeadCrypter import DeadCrypter
@@ -20,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class SpeedLoadOrgFolder(DeadCrypter):
__name__ = "SpeedLoadOrgFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?speedload\.org/(\d+~f$|folder/\d+/)'
__version__ = "0.3"
+
+ __pattern__ = r'http://(?:www\.)?speedload\.org/(\d+~f$|folder/\d+/)'
+
__description__ = """Speedload decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/crypter/StealthTo.py b/module/plugins/crypter/StealthTo.py
index e97a741e0..402724e89 100644
--- a/module/plugins/crypter/StealthTo.py
+++ b/module/plugins/crypter/StealthTo.py
@@ -1,48 +1,15 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.internal.DeadCrypter import DeadCrypter
-from module.plugins.Crypter import Crypter
-
-class StealthTo(Crypter):
+class StealthTo(DeadCrypter):
__name__ = "StealthTo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?stealth.to/folder/'
- __version__ = "0.1"
+ __version__ = "0.2"
+
+ __pattern__ = r'http://(?:www\.)?stealth\.to/folder/.+'
+
__description__ = """Stealth.to decrypter plugin"""
__author_name__ = "spoob"
__author_mail__ = "spoob@pyload.org"
-
- def __init__(self, parent):
- Crypter.__init__(self, parent)
- self.parent = parent
- self.html = None
-
- def file_exists(self):
- """ returns True or False
- """
- return True
-
- def proceed(self, url, location):
- url = self.parent.url
- self.html = self.req.load(url, cookies=True)
- temp_links = []
- ids = []
- ats = [] # authenticity_token
- inputs = re.findall(r"(<(input|form)[^>]+)", self.html)
- for input in inputs:
- if re.search(r"name=\"authenticity_token\"", input[0]):
- ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1))
- if re.search(r"name=\"id\"", input[0]):
- ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1))
-
- for i in xrange(0, len(ids)):
- self.req.load(url + "/web",
- post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))},
- cookies=True)
- new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"},
- cookies=True)
- temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1))
-
- self.links = temp_links
diff --git a/module/plugins/crypter/TnyCz.py b/module/plugins/crypter/TnyCz.py
index 6c56f7639..3ae2c5ed2 100644
--- a/module/plugins/crypter/TnyCz.py
+++ b/module/plugins/crypter/TnyCz.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Walter Purcaro
-"""
-
from module.plugins.internal.SimpleCrypter import SimpleCrypter
import re
@@ -25,14 +8,17 @@ import re
class TnyCz(SimpleCrypter):
__name__ = "TnyCz"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?tny\.cz/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?tny\.cz/\w+'
+
__description__ = """Tny.cz decrypter plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
TITLE_PATTERN = r'<title>(?P<title>.+) - .+</title>'
+
def getLinks(self):
m = re.search(r'<a id=\'save_paste\' href="(.+save\.php\?hash=.+)">', self.html)
return re.findall(".+", self.load(m.group(1), decode=True)) if m else None
diff --git a/module/plugins/crypter/TrailerzoneInfo.py b/module/plugins/crypter/TrailerzoneInfo.py
index 84a476a38..42e45a819 100644
--- a/module/plugins/crypter/TrailerzoneInfo.py
+++ b/module/plugins/crypter/TrailerzoneInfo.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class TrailerzoneInfo(DeadCrypter):
__name__ = "TrailerzoneInfo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?trailerzone.info/.*?'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?trailerzone.info/.*?'
+
__description__ = """TrailerZone.info decrypter plugin"""
__author_name__ = "godofdream"
__author_mail__ = "soilfiction@gmail.com"
diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py
index d9e63b4ce..0810e0ed1 100644
--- a/module/plugins/crypter/TurbobitNetFolder.py
+++ b/module/plugins/crypter/TurbobitNetFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-###############################################################################
import re
@@ -23,22 +9,25 @@ from module.common.json_layer import json_loads
class TurbobitNetFolder(SimpleCrypter):
__name__ = "TurbobitNetFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?turbobit\.net/download/folder/(?P<ID>\w+)'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?turbobit\.net/download/folder/(?P<ID>\w+)'
+
__description__ = """Turbobit.net folder decrypter plugin"""
__author_name__ = ("stickell", "Walter Purcaro")
__author_mail__ = ("l.stickell@yahoo.it", "vuolter@gmail.com")
TITLE_PATTERN = r"src='/js/lib/grid/icon/folder.png'> <span>(?P<title>.+?)</span>"
+
def _getLinks(self, id, page=1):
gridFile = self.load("http://turbobit.net/downloadfolder/gridFile",
get={"rootId": id, "rows": 200, "page": page}, decode=True)
grid = json_loads(gridFile)
- if grid["rows"]:
- for i in grid["rows"]:
- yield i["id"]
+ if grid['rows']:
+ for i in grid['rows']:
+ yield i['id']
for id in self._getLinks(id, page + 1):
yield id
else:
diff --git a/module/plugins/crypter/TusfilesNetFolder.py b/module/plugins/crypter/TusfilesNetFolder.py
index 0bc770f99..f51c2b715 100644
--- a/module/plugins/crypter/TusfilesNetFolder.py
+++ b/module/plugins/crypter/TusfilesNetFolder.py
@@ -1,20 +1,4 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
import math
import re
@@ -26,8 +10,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class TusfilesNetFolder(SimpleCrypter):
__name__ = "TusfilesNetFolder"
__type__ = "crypter"
+ __version__ = "0.02"
+
__pattern__ = r'https?://(?:www\.)?tusfiles\.net/go/(?P<ID>\w+)/?'
- __version__ = "0.01"
+
__description__ = """Tusfiles.net folder decrypter plugin"""
__author_name__ = ("Walter Purcaro", "stickell")
__author_mail__ = ("vuolter@gmail.com", "l.stickell@yahoo.it")
@@ -36,7 +22,8 @@ class TusfilesNetFolder(SimpleCrypter):
TITLE_PATTERN = r'<Title>.*?\: (?P<title>.+) folder</Title>'
PAGES_PATTERN = r'>\((?P<pages>\d+) \w+\)<'
- FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.tusfiles.net/go/\g<ID>/')]
+ URL_REPLACEMENTS = [(__pattern__, r'https://www.tusfiles.net/go/\g<ID>/')]
+
def loadPage(self, page_n):
return self.load(urljoin(self.pyfile.url, str(page_n)), decode=True)
diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py
index eebb14497..06d30099c 100644
--- a/module/plugins/crypter/UlozToFolder.py
+++ b/module/plugins/crypter/UlozToFolder.py
@@ -7,8 +7,10 @@ from module.plugins.Crypter import Crypter
class UlozToFolder(Crypter):
__name__ = "UlozToFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*'
__version__ = "0.2"
+
+ __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(m|soubory)/.*'
+
__description__ = """Uloz.to folder decrypter plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -17,26 +19,27 @@ class UlozToFolder(Crypter):
LINK_PATTERN = r'<br /><a href="/([^"]+)">[^<]+</a>'
NEXT_PAGE_PATTERN = r'<a class="next " href="/([^"]+)">&nbsp;</a>'
+
def decrypt(self, pyfile):
html = self.load(pyfile.url)
new_links = []
for i in xrange(1, 100):
self.logInfo("Fetching links from page %i" % i)
- found = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
- if found is None:
+ m = re.search(self.FOLDER_PATTERN, html, re.DOTALL)
+ if m is None:
self.fail("Parse error (FOLDER)")
- new_links.extend(re.findall(self.LINK_PATTERN, found.group(1)))
- found = re.search(self.NEXT_PAGE_PATTERN, html)
- if found:
- html = self.load("http://ulozto.net/" + found.group(1))
+ new_links.extend(re.findall(self.LINK_PATTERN, m.group(1)))
+ m = re.search(self.NEXT_PAGE_PATTERN, html)
+ if m:
+ html = self.load("http://ulozto.net/" + m.group(1))
else:
break
else:
self.logInfo("Limit of 99 pages reached, aborting")
if new_links:
- self.core.files.addLinks(map(lambda s: "http://ulozto.net/%s" % s, new_links), pyfile.package().id)
+ self.urls = [map(lambda s: "http://ulozto.net/%s" % s, new_links)]
else:
self.fail('Could not extract any links')
diff --git a/module/plugins/crypter/UploadableChFolder.py b/module/plugins/crypter/UploadableChFolder.py
new file mode 100644
index 000000000..b76076531
--- /dev/null
+++ b/module/plugins/crypter/UploadableChFolder.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class UploadableChFolder(SimpleCrypter):
+ __name__ = "UploadableChFolder"
+ __type__ = "crypter"
+ __version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?uploadable\.ch/list/\w+'
+
+ __description__ = """ Uploadable.ch folder decrypter plugin """
+ __author_name__ = ("guidobelix", "Walter Purcaro")
+ __author_mail__ = ("guidobelix@hotmail.it", "vuolter@gmail.com")
+
+
+ LINK_PATTERN = r'"(.+?)" class="icon_zipfile">'
+ TITLE_PATTERN = r'<div class="folder"><span>&nbsp;</span>(?P<title>.+?)</div>'
+ OFFLINE_PATTERN = r'We are sorry... The URL you entered cannot be found on the server.'
+ TEMP_OFFLINE_PATTERN = r'<div class="icon_err">'
diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py
index 97c77fdce..068412062 100644
--- a/module/plugins/crypter/UploadedToFolder.py
+++ b/module/plugins/crypter/UploadedToFolder.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
@@ -22,8 +8,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter
class UploadedToFolder(SimpleCrypter):
__name__ = "UploadedToFolder"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)'
__version__ = "0.3"
+
+ __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)'
+
__description__ = """UploadedTo decrypter plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
@@ -31,6 +19,7 @@ class UploadedToFolder(SimpleCrypter):
PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick='
TITLE_PATTERN = r'<title>(?P<title>[^<]+)</title>'
+
def decrypt(self, pyfile):
self.html = self.load(pyfile.url)
diff --git a/module/plugins/crypter/WiiReloadedOrg.py b/module/plugins/crypter/WiiReloadedOrg.py
index 0b983c705..cb02fbd2d 100644
--- a/module/plugins/crypter/WiiReloadedOrg.py
+++ b/module/plugins/crypter/WiiReloadedOrg.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadCrypter import DeadCrypter
class WiiReloadedOrg(DeadCrypter):
__name__ = "WiiReloadedOrg"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?wii-reloaded\.org/protect/get\.php\?i=.+'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?wii-reloaded\.org/protect/get\.php\?i=.+'
+
__description__ = """Wii-Reloaded.org decrypter plugin"""
__author_name__ = "hzpz"
- __author_mail__ = ""
+ __author_mail__ = None
diff --git a/module/plugins/crypter/XupPl.py b/module/plugins/crypter/XupPl.py
index c04fc69f8..5e5f511a8 100644
--- a/module/plugins/crypter/XupPl.py
+++ b/module/plugins/crypter/XupPl.py
@@ -6,15 +6,18 @@ from module.plugins.Crypter import Crypter
class XupPl(Crypter):
__name__ = "XupPl"
__type__ = "crypter"
- __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.*'
__version__ = "0.1"
+
+ __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.*'
+
__description__ = """Xup.pl decrypter plugin"""
__author_name__ = "z00nx"
__author_mail__ = "z00nx0@gmail.com"
+
def decrypt(self, pyfile):
header = self.load(pyfile.url, just_header=True)
if 'location' in header:
- self.core.files.addLinks([header['location']], pyfile.package().id)
+ self.urls = [header['location']]
else:
self.fail('Unable to find link')
diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py
index e6976471c..1caca16bd 100644
--- a/module/plugins/crypter/YoutubeBatch.py
+++ b/module/plugins/crypter/YoutubeBatch.py
@@ -1,44 +1,31 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Walter Purcaro
-"""
+import re
from urlparse import urljoin
-import re
from module.common.json_layer import json_loads
from module.plugins.Crypter import Crypter
from module.utils import save_join
-API_KEY = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0"
+API_URL = "AIzaSyCKnWLNlkX-L4oD1aEzqqhRw1zczeD6_k0"
class YoutubeBatch(Crypter):
__name__ = "YoutubeBatch"
__type__ = "crypter"
- __pattern__ = r'https?://(?:www\.)?(m\.)?youtube\.com/(?P<TYPE>user|playlist|view_play_list)(/|.*?[?&](?:list|p)=)(?P<ID>[\w-]+)'
__version__ = "1.00"
- __description__ = """Youtube.com channel & playlist decrypter plugin"""
+
+ __pattern__ = r'https?://(?:www\.|m\.)?youtube\.com/(?P<TYPE>user|playlist|view_play_list)(/|.*?[?&](?:list|p)=)(?P<ID>[\w-]+)'
__config__ = [("likes", "bool", "Grab user (channel) liked videos", False),
("favorites", "bool", "Grab user (channel) favorite videos", False),
("uploads", "bool", "Grab channel unplaylisted videos", True)]
+
+ __description__ = """Youtube.com channel & playlist decrypter plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
+
def api_response(self, ref, req):
req.update({"key": API_KEY})
url = urljoin("https://www.googleapis.com/youtube/v3/", ref)
@@ -47,21 +34,21 @@ class YoutubeBatch(Crypter):
def getChannel(self, user):
channels = self.api_response("channels", {"part": "id,snippet,contentDetails", "forUsername": user, "maxResults": "50"})
- if channels["items"]:
- channel = channels["items"][0]
- return {"id": channel["id"],
- "title": channel["snippet"]["title"],
- "relatedPlaylists": channel["contentDetails"]["relatedPlaylists"],
+ if channels['items']:
+ channel = channels['items'][0]
+ return {"id": channel['id'],
+ "title": channel['snippet']['title'],
+ "relatedPlaylists": channel['contentDetails']['relatedPlaylists'],
"user": user} # One lone channel for user?
def getPlaylist(self, p_id):
playlists = self.api_response("playlists", {"part": "snippet", "id": p_id})
- if playlists["items"]:
- playlist = playlists["items"][0]
+ if playlists['items']:
+ playlist = playlists['items'][0]
return {"id": p_id,
- "title": playlist["snippet"]["title"],
- "channelId": playlist["snippet"]["channelId"],
- "channelTitle": playlist["snippet"]["channelTitle"]}
+ "title": playlist['snippet']['title'],
+ "channelId": playlist['snippet']['channelId'],
+ "channelTitle": playlist['snippet']['channelTitle']}
def _getPlaylists(self, id, token=None):
req = {"part": "id", "maxResults": "50", "channelId": id}
@@ -70,11 +57,11 @@ class YoutubeBatch(Crypter):
playlists = self.api_response("playlists", req)
- for playlist in playlists["items"]:
- yield playlist["id"]
+ for playlist in playlists['items']:
+ yield playlist['id']
if "nextPageToken" in playlists:
- for item in self._getPlaylists(id, playlists["nextPageToken"]):
+ for item in self._getPlaylists(id, playlists['nextPageToken']):
yield item
def getPlaylists(self, ch_id):
@@ -87,20 +74,20 @@ class YoutubeBatch(Crypter):
playlist = self.api_response("playlistItems", req)
- for item in playlist["items"]:
- yield item["contentDetails"]["videoId"]
+ for item in playlist['items']:
+ yield item['contentDetails']['videoId']
if "nextPageToken" in playlist:
- for item in self._getVideosId(id, playlist["nextPageToken"]):
+ for item in self._getVideosId(id, playlist['nextPageToken']):
yield item
def getVideosId(self, p_id):
return list(self._getVideosId(p_id))
def decrypt(self, pyfile):
- match = re.match(self.__pattern__, pyfile.url)
- m_id = match.group("ID")
- m_type = match.group("TYPE")
+ m = re.match(self.__pattern__, pyfile.url)
+ m_id = m.group("ID")
+ m_type = m.group("TYPE")
if m_type == "user":
self.logDebug("Url recognized as Channel")
@@ -108,18 +95,18 @@ class YoutubeBatch(Crypter):
channel = self.getChannel(user)
if channel:
- playlists = self.getPlaylists(channel["id"])
- self.logDebug("%s playlist\s found on channel \"%s\"" % (len(playlists), channel["title"]))
+ playlists = self.getPlaylists(channel['id'])
+ self.logDebug("%s playlist\s found on channel \"%s\"" % (len(playlists), channel['title']))
- relatedplaylist = {p_name: self.getPlaylist(p_id) for p_name, p_id in channel["relatedPlaylists"].iteritems()}
+ relatedplaylist = {p_name: self.getPlaylist(p_id) for p_name, p_id in channel['relatedPlaylists'].iteritems()}
self.logDebug("Channel's related playlists found = %s" % relatedplaylist.keys())
- relatedplaylist["uploads"]["title"] = "Unplaylisted videos"
- relatedplaylist["uploads"]["checkDups"] = True #: checkDups flag
+ relatedplaylist['uploads']['title'] = "Unplaylisted videos"
+ relatedplaylist['uploads']['checkDups'] = True #: checkDups flag
for p_name, p_data in relatedplaylist.iteritems():
if self.getConfig(p_name):
- p_data["title"] += " of " + user
+ p_data['title'] += " of " + user
playlists.append(p_data)
else:
playlists = []
@@ -133,9 +120,9 @@ class YoutubeBatch(Crypter):
addedvideos = []
urlize = lambda x: "https://www.youtube.com/watch?v=" + x
for p in playlists:
- p_name = p["title"]
- p_videos = self.getVideosId(p["id"])
- p_folder = save_join(self.config['general']['download_folder'], p["channelTitle"], p_name)
+ p_name = p['title']
+ p_videos = self.getVideosId(p['id'])
+ p_folder = save_join(self.config['general']['download_folder'], p['channelTitle'], p_name)
self.logDebug("%s video\s found on playlist \"%s\"" % (len(p_videos), p_name))
if not p_videos:
diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py
index 0f8d3bfbb..906875a69 100644
--- a/module/plugins/hooks/AlldebridCom.py
+++ b/module/plugins/hooks/AlldebridCom.py
@@ -1,15 +1,13 @@
# -*- coding: utf-8 -*-
-# should be working
-
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
class AlldebridCom(MultiHoster):
__name__ = "AlldebridCom"
- __version__ = "0.13"
__type__ = "hook"
+ __version__ = "0.13"
__config__ = [("activated", "bool", "Activated", False),
("https", "bool", "Enable HTTPS", False),
@@ -22,6 +20,7 @@ class AlldebridCom(MultiHoster):
__author_name__ = "Andy Voigt"
__author_mail__ = "spamsales@online.de"
+
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"", "").strip()
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
index 70e60f56c..d62de24a7 100644
--- a/module/plugins/hooks/BypassCaptcha.py
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -1,34 +1,15 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN, Godofdream, zoidberg
-"""
-
-from thread import start_new_thread
from pycurl import FORM_FILE, LOW_SPEED_TIME
+from thread import start_new_thread
-from module.network.RequestFactory import getURL, getRequest
from module.network.HTTPRequest import BadHeader
-
+from module.network.RequestFactory import getURL, getRequest
from module.plugins.Hook import Hook
-PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32"
-
class BypassCaptchaException(Exception):
+
def __init__(self, err):
self.err = err
@@ -44,18 +25,24 @@ class BypassCaptchaException(Exception):
class BypassCaptcha(Hook):
__name__ = "BypassCaptcha"
+ __type__ = "hook"
__version__ = "0.04"
- __description__ = """Send captchas to BypassCaptcha.com"""
+
__config__ = [("activated", "bool", "Activated", False),
("force", "bool", "Force BC even if client is connected", False),
("passkey", "password", "Passkey", "")]
+
+ __description__ = """Send captchas to BypassCaptcha.com"""
__author_name__ = ("RaNaN", "Godofdream", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "soilfcition@gmail.com", "zoidberg@mujmail.cz")
+ PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32"
+
SUBMIT_URL = "http://bypasscaptcha.com/upload.php"
RESPOND_URL = "http://bypasscaptcha.com/check_value.php"
GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php"
+
def setup(self):
self.info = {}
@@ -73,7 +60,7 @@ class BypassCaptcha(Hook):
try:
response = req.load(self.SUBMIT_URL,
- post={"vendor_key": PYLOAD_KEY,
+ post={"vendor_key": self.PYLOAD_KEY,
"key": self.getConfig("passkey"),
"gen_task_id": "1",
"file": (FORM_FILE, captcha)},
@@ -122,11 +109,11 @@ class BypassCaptcha(Hook):
def captchaCorrect(self, task):
if task.data['service'] == self.__name__ and "ticket" in task.data:
- self.respond(task.data["ticket"], True)
+ self.respond(task.data['ticket'], True)
def captchaInvalid(self, task):
if task.data['service'] == self.__name__ and "ticket" in task.data:
- self.respond(task.data["ticket"], False)
+ self.respond(task.data['ticket'], False)
def processCaptcha(self, task):
c = task.captchaFile
@@ -136,5 +123,5 @@ class BypassCaptcha(Hook):
task.error = e.getCode()
return
- task.data["ticket"] = ticket
+ task.data['ticket'] = ticket
task.setResult(result)
diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py
index c86f92972..1b7406edd 100755
--- a/module/plugins/hooks/Captcha9kw.py
+++ b/module/plugins/hooks/Captcha9kw.py
@@ -1,37 +1,22 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, RaNaN, zoidberg
-"""
from __future__ import with_statement
-from thread import start_new_thread
-from base64 import b64encode
import time
-from module.network.RequestFactory import getURL
-from module.network.HTTPRequest import BadHeader
+from base64 import b64encode
+from thread import start_new_thread
+from module.network.HTTPRequest import BadHeader
+from module.network.RequestFactory import getURL
from module.plugins.Hook import Hook
class Captcha9kw(Hook):
__name__ = "Captcha9kw"
+ __type__ = "hook"
__version__ = "0.09"
- __description__ = """Send captchas to 9kw.eu"""
+
__config__ = [("activated", "bool", "Activated", False),
("force", "bool", "Force CT even if client is connected", True),
("https", "bool", "Enable HTTPS", False),
@@ -43,11 +28,14 @@ class Captcha9kw(Hook):
False),
("timeout", "int", "Timeout (max. 300)", 300),
("passkey", "password", "API key", "")]
+
+ __description__ = """Send captchas to 9kw.eu"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
API_URL = "://www.9kw.eu/index.cgi"
+
def setup(self):
self.API_URL = "https" + self.API_URL if self.getConfig("https") else "http" + self.API_URL
self.info = {}
@@ -58,7 +46,7 @@ class Captcha9kw(Hook):
if response.isdigit():
self.logInfo(_("%s credits left") % response)
- self.info["credits"] = credits = int(response)
+ self.info['credits'] = credits = int(response)
return credits
else:
self.logError(response)
@@ -104,7 +92,7 @@ class Captcha9kw(Hook):
time.sleep(3)
result = response2
- task.data["ticket"] = response
+ task.data['ticket'] = response
self.logInfo("result %s : %s" % (response, result))
task.setResult(result)
else:
@@ -140,7 +128,7 @@ class Captcha9kw(Hook):
"correct": "1",
"pyload": "1",
"source": "pyload",
- "id": task.data["ticket"]})
+ "id": task.data['ticket']})
self.logInfo("Request correct: %s" % response)
except BadHeader, e:
@@ -159,7 +147,7 @@ class Captcha9kw(Hook):
"correct": "2",
"pyload": "1",
"source": "pyload",
- "id": task.data["ticket"]})
+ "id": task.data['ticket']})
self.logInfo("Request refund: %s" % response)
except BadHeader, e:
diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py
index 23d71ff5f..e240cbbc0 100644
--- a/module/plugins/hooks/CaptchaBrotherhood.py
+++ b/module/plugins/hooks/CaptchaBrotherhood.py
@@ -1,36 +1,21 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, RaNaN, zoidberg
-"""
from __future__ import with_statement
-from thread import start_new_thread
-
-import pycurl
import StringIO
-from urllib import urlencode
-from time import sleep
+import pycurl
+
from PIL import Image
+from thread import start_new_thread
+from time import sleep
+from urllib import urlencode
from module.network.RequestFactory import getURL, getRequest
from module.plugins.Hook import Hook
class CaptchaBrotherhoodException(Exception):
+
def __init__(self, err):
self.err = err
@@ -46,17 +31,21 @@ class CaptchaBrotherhoodException(Exception):
class CaptchaBrotherhood(Hook):
__name__ = "CaptchaBrotherhood"
+ __type__ = "hook"
__version__ = "0.05"
- __description__ = """Send captchas to CaptchaBrotherhood.com"""
+
__config__ = [("activated", "bool", "Activated", False),
("username", "str", "Username", ""),
("force", "bool", "Force CT even if client is connected", False),
("passkey", "password", "Password", "")]
+
+ __description__ = """Send captchas to CaptchaBrotherhood.com"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
API_URL = "http://www.captchabrotherhood.com/"
+
def setup(self):
self.info = {}
@@ -68,7 +57,7 @@ class CaptchaBrotherhood(Hook):
else:
credits = int(response[3:])
self.logInfo(_("%d credits left") % credits)
- self.info["credits"] = credits
+ self.info['credits'] = credits
return credits
def submit(self, captcha, captchaType="file", match=None):
@@ -164,5 +153,5 @@ class CaptchaBrotherhood(Hook):
task.error = e.getCode()
return
- task.data["ticket"] = ticket
+ task.data['ticket'] = ticket
task.setResult(result)
diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py
deleted file mode 100644
index 051dc6c2b..000000000
--- a/module/plugins/hooks/CaptchaTrader.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
- 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/>.
-
- @author: mkaay, RaNaN
-"""
-
-from thread import start_new_thread
-from pycurl import FORM_FILE, LOW_SPEED_TIME
-
-from module.common.json_layer import json_loads
-from module.network.RequestFactory import getURL, getRequest
-from module.network.HTTPRequest import BadHeader
-from module.plugins.Hook import Hook
-
-PYLOAD_KEY = "9f65e7f381c3af2b076ea680ae96b0b7"
-
-
-class CaptchaTraderException(Exception):
- def __init__(self, err):
- self.err = err
-
- def getCode(self):
- return self.err
-
- def __str__(self):
- return "<CaptchaTraderException %s>" % self.err
-
- def __repr__(self):
- return "<CaptchaTraderException %s>" % self.err
-
-
-class CaptchaTrader(Hook):
- __name__ = "CaptchaTrader"
- __version__ = "0.16"
- __description__ = """Send captchas to captchatrader.com"""
- __config__ = [("activated", "bool", "Activated", False),
- ("username", "str", "Username", ""),
- ("force", "bool", "Force CT even if client is connected", False),
- ("passkey", "password", "Password", "")]
- __author_name__ = "RaNaN"
- __author_mail__ = "RaNaN@pyload.org"
-
- SUBMIT_URL = "http://api.captchatrader.com/submit"
- RESPOND_URL = "http://api.captchatrader.com/respond"
- GETCREDITS_URL = "http://api.captchatrader.com/get_credits/username:%(user)s/password:%(password)s/"
-
- def setup(self):
- self.info = {}
-
- def getCredits(self):
- json = getURL(CaptchaTrader.GETCREDITS_URL % {"user": self.getConfig("username"),
- "password": self.getConfig("passkey")})
- response = json_loads(json)
- if response[0] < 0:
- raise CaptchaTraderException(response[1])
- else:
- self.logInfo(_("%s credits left") % response[1])
- self.info["credits"] = response[1]
- return response[1]
-
- def submit(self, captcha, captchaType="file", match=None):
- if not PYLOAD_KEY:
- raise CaptchaTraderException("No API Key Specified!")
-
- #if type(captcha) == str and captchaType == "file":
- # raise CaptchaTraderException("Invalid Type")
- assert captchaType in ("file", "url-jpg", "url-jpeg", "url-png", "url-bmp")
-
- req = getRequest()
-
- #raise timeout threshold
- req.c.setopt(LOW_SPEED_TIME, 80)
-
- try:
- json = req.load(CaptchaTrader.SUBMIT_URL, post={"api_key": PYLOAD_KEY,
- "username": self.getConfig("username"),
- "password": self.getConfig("passkey"),
- "value": (FORM_FILE, captcha),
- "type": captchaType}, multipart=True)
- finally:
- req.close()
-
- response = json_loads(json)
- if response[0] < 0:
- raise CaptchaTraderException(response[1])
-
- ticket = response[0]
- result = response[1]
- self.logDebug("result %s : %s" % (ticket, result))
-
- return ticket, result
-
- def respond(self, ticket, success):
- try:
- json = getURL(CaptchaTrader.RESPOND_URL, post={"is_correct": 1 if success else 0,
- "username": self.getConfig("username"),
- "password": self.getConfig("passkey"),
- "ticket": ticket})
-
- response = json_loads(json)
- if response[0] < 0:
- raise CaptchaTraderException(response[1])
-
- except BadHeader, e:
- self.logError(_("Could not send response."), str(e))
-
- def newCaptchaTask(self, task):
- if not task.isTextual():
- return False
-
- if not self.getConfig("username") or not self.getConfig("passkey"):
- return False
-
- if self.core.isClientConnected() and not self.getConfig("force"):
- return False
-
- if self.getCredits() > 10:
- task.handler.append(self)
- task.setWaiting(100)
- start_new_thread(self.processCaptcha, (task,))
-
- else:
- self.logInfo(_("Your CaptchaTrader Account has not enough credits"))
-
- def captchaCorrect(self, task):
- if "ticket" in task.data:
- ticket = task.data["ticket"]
- self.respond(ticket, True)
-
- def captchaInvalid(self, task):
- if "ticket" in task.data:
- ticket = task.data["ticket"]
- self.respond(ticket, False)
-
- def processCaptcha(self, task):
- c = task.captchaFile
- try:
- ticket, result = self.submit(c)
- except CaptchaTraderException, e:
- task.error = e.getCode()
- return
-
- task.data["ticket"] = ticket
- task.setResult(result)
diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py
index af37d69e6..013172899 100644
--- a/module/plugins/hooks/Checksum.py
+++ b/module/plugins/hooks/Checksum.py
@@ -1,31 +1,16 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from __future__ import with_statement
+
import hashlib
+import re
import zlib
+
from os import remove
from os.path import getsize, isfile, splitext
-import re
-from module.utils import save_join, fs_encode
from module.plugins.Hook import Hook
+from module.utils import save_join, fs_encode
def computeChecksum(local_file, algorithm):
@@ -54,15 +39,19 @@ def computeChecksum(local_file, algorithm):
class Checksum(Hook):
__name__ = "Checksum"
- __version__ = "0.12"
- __description__ = """Verify downloaded file size and checksum"""
+ __type__ = "hook"
+ __version__ = "0.13"
+
__config__ = [("activated", "bool", "Activated", False),
+ ("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True),
("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"),
("max_tries", "int", "Number of retries", 2),
("retry_action", "fail;nothing", "What to do if all retries fail?", "fail"),
("wait_time", "int", "Time to wait before each retry (seconds)", 1)]
- __author_name__ = ("zoidberg", "Walter Purcaro")
- __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com")
+
+ __description__ = """Verify downloaded file size and checksum"""
+ __author_name__ = ("zoidberg", "Walter Purcaro", "stickell")
+ __author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com", "l.stickell@yahoo.it")
methods = {'sfv': 'crc32', 'crc': 'crc32', 'hash': 'md5'}
regexps = {'sfv': r'^(?P<name>[^;].+)\s+(?P<hash>[0-9A-Fa-f]{8})$',
@@ -70,15 +59,16 @@ class Checksum(Hook):
'crc': r'filename=(?P<name>.+)\nsize=(?P<size>\d+)\ncrc32=(?P<hash>[0-9A-Fa-f]{8})$',
'default': r'^(?P<hash>[0-9A-Fa-f]+)\s+\*?(?P<name>.+)$'}
+
def coreReady(self):
- if not self.config['general']['checksum']:
- self.logInfo("Checksum validation is disabled in general configuration")
+ if not self.getConfig("check_checksum"):
+ self.logInfo("Checksum validation is disabled in plugin configuration")
def setup(self):
self.algorithms = sorted(
getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse=True)
self.algorithms.extend(["crc32", "adler32"])
- self.formats = self.algorithms + ['sfv', 'crc', 'hash']
+ self.formats = self.algorithms + ["sfv", "crc", "hash"]
def downloadFinished(self, pyfile):
"""
@@ -116,7 +106,7 @@ class Checksum(Hook):
del data['size']
# validate checksum
- if data and self.config['general']['checksum']:
+ if data and self.getConfig("check_checksum"):
if "checksum" in data:
data['md5'] = data['checksum']
@@ -156,15 +146,15 @@ class Checksum(Hook):
download_folder = save_join(self.config['general']['download_folder'], pypack.folder, "")
for link in pypack.getChildren().itervalues():
- file_type = splitext(link["name"])[1][1:].lower()
+ file_type = splitext(link['name'])[1][1:].lower()
#self.logDebug(link, file_type)
if file_type not in self.formats:
continue
- hash_file = fs_encode(save_join(download_folder, link["name"]))
+ hash_file = fs_encode(save_join(download_folder, link['name']))
if not isfile(hash_file):
- self.logWarning("File not found: %s" % link["name"])
+ self.logWarning("File not found: %s" % link['name'])
continue
with open(hash_file) as f:
@@ -172,14 +162,14 @@ class Checksum(Hook):
for m in re.finditer(self.regexps.get(file_type, self.regexps['default']), text):
data = m.groupdict()
- self.logDebug(link["name"], data)
+ self.logDebug(link['name'], data)
- local_file = fs_encode(save_join(download_folder, data["name"]))
+ local_file = fs_encode(save_join(download_folder, data['name']))
algorithm = self.methods.get(file_type, file_type)
checksum = computeChecksum(local_file, algorithm)
- if checksum == data["hash"]:
+ if checksum == data['hash']:
self.logInfo('File integrity of "%s" verified by %s checksum (%s).' %
- (data["name"], algorithm, checksum))
+ (data['name'], algorithm, checksum))
else:
self.logWarning("%s checksum for file %s does not match (%s != %s)" %
- (algorithm, data["name"], checksum, data["hash"]))
+ (algorithm, data['name'], checksum, data['hash']))
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py
index 002fd4cd7..5c523caf7 100644
--- a/module/plugins/hooks/ClickAndLoad.py
+++ b/module/plugins/hooks/ClickAndLoad.py
@@ -1,23 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
- @interface-version: 0.2
-"""
-
import socket
import thread
@@ -26,13 +8,17 @@ from module.plugins.Hook import Hook
class ClickAndLoad(Hook):
__name__ = "ClickAndLoad"
+ __type__ = "hook"
__version__ = "0.22"
- __description__ = """Gives abillity to use jd's click and load. depends on webinterface"""
+
__config__ = [("activated", "bool", "Activated", True),
("extern", "bool", "Allow external link adding", False)]
+
+ __description__ = """Gives abillity to use jd's click and load. depends on webinterface"""
__author_name__ = ("RaNaN", "mkaay")
__author_mail__ = ("RaNaN@pyload.de", "mkaay@mkaay.de")
+
def coreReady(self):
self.port = int(self.config['webinterface']['port'])
if self.config['webinterface']['activated']:
diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py
index f7bc1b90f..530395d32 100644
--- a/module/plugins/hooks/DeathByCaptcha.py
+++ b/module/plugins/hooks/DeathByCaptcha.py
@@ -1,33 +1,18 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, RaNaN, zoidberg
-"""
from __future__ import with_statement
-from thread import start_new_thread
+import re
+
+from base64 import b64encode
from pycurl import FORM_FILE, HTTPHEADER
+from thread import start_new_thread
from time import sleep
-from base64 import b64encode
-import re
-from module.network.RequestFactory import getRequest
+from module.common.json_layer import json_loads
from module.network.HTTPRequest import BadHeader
+from module.network.RequestFactory import getRequest
from module.plugins.Hook import Hook
-from module.common.json_layer import json_loads
class DeathByCaptchaException(Exception):
@@ -61,17 +46,21 @@ class DeathByCaptchaException(Exception):
class DeathByCaptcha(Hook):
__name__ = "DeathByCaptcha"
+ __type__ = "hook"
__version__ = "0.03"
- __description__ = """Send captchas to DeathByCaptcha.com"""
+
__config__ = [("activated", "bool", "Activated", False),
("username", "str", "Username", ""),
("passkey", "password", "Password", ""),
("force", "bool", "Force DBC even if client is connected", False)]
+
+ __description__ = """Send captchas to DeathByCaptcha.com"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
API_URL = "http://api.dbcapi.me/api/"
+
def setup(self):
self.info = {}
@@ -132,7 +121,7 @@ class DeathByCaptcha(Hook):
raise DeathByCaptchaException('service-overload')
def submit(self, captcha, captchaType="file", match=None):
- #workaround multipart-post bug in HTTPRequest.py
+ #workaround multipart-post bug in HTTPRequest.py
if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")):
multipart = True
data = (FORM_FILE, captcha)
@@ -181,7 +170,7 @@ class DeathByCaptcha(Hook):
self.logError(e.getDesc())
return False
- balance, rate = self.info["balance"], self.info["rate"]
+ balance, rate = self.info['balance'], self.info['rate']
self.logInfo("Account balance: US$%.3f (%d captchas left at %.2f cents each)" % (balance / 100,
balance // rate, rate))
@@ -194,7 +183,7 @@ class DeathByCaptcha(Hook):
def captchaInvalid(self, task):
if task.data['service'] == self.__name__ and "ticket" in task.data:
try:
- response = self.call_api("captcha/%d/report" % task.data["ticket"], True)
+ response = self.call_api("captcha/%d/report" % task.data['ticket'], True)
except DeathByCaptchaException, e:
self.logError(e.getDesc())
except Exception, e:
@@ -209,5 +198,5 @@ class DeathByCaptcha(Hook):
self.logError(e.getDesc())
return
- task.data["ticket"] = ticket
+ task.data['ticket'] = ticket
task.setResult(result)
diff --git a/module/plugins/hooks/DebridItaliaCom.py b/module/plugins/hooks/DebridItaliaCom.py
index fb6be674f..88efb6b2a 100644
--- a/module/plugins/hooks/DebridItaliaCom.py
+++ b/module/plugins/hooks/DebridItaliaCom.py
@@ -1,26 +1,13 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.internal.MultiHoster import MultiHoster
class DebridItaliaCom(MultiHoster):
__name__ = "DebridItaliaCom"
- __version__ = "0.07"
__type__ = "hook"
+ __version__ = "0.07"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
@@ -31,6 +18,7 @@ class DebridItaliaCom(MultiHoster):
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def getHoster(self):
return ["netload.in", "hotfile.com", "rapidshare.com", "multiupload.com",
"uploading.com", "megashares.com", "crocko.com", "filepost.com",
diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py
index 3bc98a7b3..bc926906f 100644
--- a/module/plugins/hooks/DeleteFinished.py
+++ b/module/plugins/hooks/DeleteFinished.py
@@ -1,37 +1,22 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Walter Purcaro
-"""
-
from module.database import style
from module.plugins.Hook import Hook
class DeleteFinished(Hook):
- __name__ = 'DeleteFinished'
- __version__ = '1.09'
- __description__ = 'Automatically delete all finished packages from queue'
- __config__ = [
- ('activated', 'bool', 'Activated', 'False'),
- ('interval', 'int', 'Delete every (hours)', '72'),
- ('deloffline', 'bool', 'Delete packages with offline links', 'False')
- ]
- __author_name__ = ('Walter Purcaro')
- __author_mail__ = ('vuolter@gmail.com')
+ __name__ = "DeleteFinished"
+ __type__ = "hook"
+ __version__ = "1.09"
+
+ __config__ = [('activated', 'bool', 'Activated', 'False'),
+ ('interval', 'int', 'Delete every (hours)', '72'),
+ ('deloffline', 'bool', 'Delete packages with offline links', 'False')]
+
+ __description__ = """Automatically delete all finished packages from queue"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
+
## overwritten methods ##
def periodical(self):
diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py
index 41a20e5d1..a3d70b3ab 100644
--- a/module/plugins/hooks/DownloadScheduler.py
+++ b/module/plugins/hooks/DownloadScheduler.py
@@ -1,22 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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.
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-
- @author: zoidberg
- Original idea by new.cze
-"""
-
import re
+
from time import localtime
from module.plugins.Hook import Hook
@@ -24,15 +9,19 @@ from module.plugins.Hook import Hook
class DownloadScheduler(Hook):
__name__ = "DownloadScheduler"
+ __type__ = "hook"
__version__ = "0.21"
- __description__ = """Download Scheduler"""
+
__config__ = [("activated", "bool", "Activated", False),
("timetable", "str", "List time periods as hh:mm full or number(kB/s)",
"0:00 full, 7:00 250, 10:00 0, 17:00 150"),
("abort", "bool", "Abort active downloads when start period with speed 0", False)]
+
+ __description__ = """Download Scheduler"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
def setup(self):
self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded
diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py
index a3a2dcb92..da37297d9 100644
--- a/module/plugins/hooks/EasybytezCom.py
+++ b/module/plugins/hooks/EasybytezCom.py
@@ -7,15 +7,18 @@ from module.plugins.internal.MultiHoster import MultiHoster
class EasybytezCom(MultiHoster):
__name__ = "EasybytezCom"
- __version__ = "0.03"
__type__ = "hook"
+ __version__ = "0.03"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", "")]
+
__description__ = """EasyBytez.com hook plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def getHoster(self):
self.account = self.core.accountManager.getAccountPlugin(self.__name__)
user = self.account.selectAccount()[0]
@@ -24,11 +27,11 @@ class EasybytezCom(MultiHoster):
req = self.account.getAccountRequest(user)
page = req.load("http://www.easybytez.com")
- found = re.search(r'</textarea>\s*Supported sites:(.*)', page)
- return found.group(1).split(',')
+ m = re.search(r'</textarea>\s*Supported sites:(.*)', page)
+ return m.group(1).split(',')
except Exception, e:
self.logDebug(e)
self.logWarning("Unable to load supported hoster list, using last known")
- return ['bitshare.com', 'crocko.com', 'ddlstorage.com', 'depositfiles.com', 'extabit.com', 'hotfile.com',
- 'mediafire.com', 'netload.in', 'rapidgator.net', 'rapidshare.com', 'uploading.com', 'uload.to',
- 'uploaded.to']
+ return ["bitshare.com", "crocko.com", "ddlstorage.com", "depositfiles.com", "extabit.com", "hotfile.com",
+ "mediafire.com", "netload.in", "rapidgator.net", "rapidshare.com", "uploading.com", "uload.to",
+ "uploaded.to"]
diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py
index 1e2b62062..c54c38bc6 100644
--- a/module/plugins/hooks/Ev0InFetcher.py
+++ b/module/plugins/hooks/Ev0InFetcher.py
@@ -1,31 +1,17 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
from time import mktime, time
from module.lib import feedparser
+
from module.plugins.Hook import Hook
class Ev0InFetcher(Hook):
__name__ = "Ev0InFetcher"
+ __type__ = "hook"
__version__ = "0.21"
- __description__ = """Checks rss feeds for Ev0.in"""
+
__config__ = [("activated", "bool", "Activated", False),
("interval", "int", "Check interval in minutes", 10),
("queue", "bool", "Move new shows directly to Queue", False),
@@ -33,9 +19,12 @@ class Ev0InFetcher(Hook):
("quality", "xvid;x264;rmvb", "Video Format", "xvid"),
("hoster", "str", "Hoster to use (comma seperated)",
"NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")]
+
+ __description__ = """Checks rss feeds for Ev0.in"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def setup(self):
self.interval = self.getConfig("interval") * 60
@@ -55,7 +44,9 @@ class Ev0InFetcher(Hook):
continue
return []
+
def periodical(self):
+
def normalizefiletitle(filename):
filename = filename.replace('.', ' ')
filename = filename.replace('_', ' ')
diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py
index 7be30f86e..c7ab80da0 100644
--- a/module/plugins/hooks/ExpertDecoders.py
+++ b/module/plugins/hooks/ExpertDecoders.py
@@ -1,46 +1,33 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, RaNaN, zoidberg
-"""
from __future__ import with_statement
-from thread import start_new_thread
+from base64 import b64encode
from pycurl import LOW_SPEED_TIME
+from thread import start_new_thread
from uuid import uuid4
-from base64 import b64encode
-from module.network.RequestFactory import getURL, getRequest
from module.network.HTTPRequest import BadHeader
-
+from module.network.RequestFactory import getURL, getRequest
from module.plugins.Hook import Hook
class ExpertDecoders(Hook):
__name__ = "ExpertDecoders"
+ __type__ = "hook"
__version__ = "0.01"
- __description__ = """Send captchas to expertdecoders.com"""
+
__config__ = [("activated", "bool", "Activated", False),
("force", "bool", "Force CT even if client is connected", False),
("passkey", "password", "Access key", "")]
+
+ __description__ = """Send captchas to expertdecoders.com"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
API_URL = "http://www.fasttypers.org/imagepost.ashx"
+
def setup(self):
self.info = {}
@@ -49,14 +36,14 @@ class ExpertDecoders(Hook):
if response.isdigit():
self.logInfo(_("%s credits left") % response)
- self.info["credits"] = credits = int(response)
+ self.info['credits'] = credits = int(response)
return credits
else:
self.logError(response)
return 0
def processCaptcha(self, task):
- task.data["ticket"] = ticket = uuid4()
+ task.data['ticket'] = ticket = uuid4()
result = None
with open(task.captchaFile, 'rb') as f:
@@ -100,7 +87,7 @@ class ExpertDecoders(Hook):
try:
response = getURL(self.API_URL, post={"action": "refund", "key": self.getConfig("passkey"),
- "gen_task_id": task.data["ticket"]})
+ "gen_task_id": task.data['ticket']})
self.logInfo("Request refund: %s" % response)
except BadHeader, e:
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 3d84dcc3d..8d03d27d4 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -1,24 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
- @interface-version: 0.1
-"""
-
import subprocess
+
from os import listdir, access, X_OK, makedirs
from os.path import join, exists, basename, abspath
@@ -28,20 +11,24 @@ from module.utils import save_join
class ExternalScripts(Hook):
__name__ = "ExternalScripts"
+ __type__ = "hook"
__version__ = "0.23"
- __description__ = """Run external scripts"""
+
__config__ = [("activated", "bool", "Activated", True)]
+
+ __description__ = """Run external scripts"""
__author_name__ = ("mkaay", "RaNaN", "spoob")
__author_mail__ = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org")
event_list = ["unrarFinished", "allDownloadsFinished", "allDownloadsProcessed"]
+
def setup(self):
self.scripts = {}
- folders = ['download_preparing', 'download_finished', 'package_finished',
- 'before_reconnect', 'after_reconnect', 'unrar_finished',
- 'all_dls_finished', 'all_dls_processed']
+ folders = ["download_preparing", "download_finished", "package_finished",
+ "before_reconnect", "after_reconnect", "unrar_finished",
+ "all_dls_finished", "all_dls_processed"]
for folder in folders:
self.scripts[folder] = []
@@ -105,13 +92,13 @@ class ExternalScripts(Hook):
self.callScript(script, ip)
def unrarFinished(self, folder, fname):
- for script in self.scripts["unrar_finished"]:
+ for script in self.scripts['unrar_finished']:
self.callScript(script, folder, fname)
def allDownloadsFinished(self):
- for script in self.scripts["all_dls_finished"]:
+ for script in self.scripts['all_dls_finished']:
self.callScript(script)
def allDownloadsProcessed(self):
- for script in self.scripts["all_dls_processed"]:
+ for script in self.scripts['all_dls_processed']:
self.callScript(script)
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 12e53fe50..144829459 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -1,19 +1,18 @@
# -*- coding: utf-8 -*-
-import sys
import os
+import sys
+
+from copy import copy
from os import remove, chmod, makedirs
-from os.path import exists, basename, isfile, isdir, join
+from os.path import exists, basename, isfile, isdir
from traceback import print_exc
-from copy import copy
# monkey patch bug in python 2.6 and lower
-# see http://bugs.python.org/issue6122
-# http://bugs.python.org/issue1236
-# http://bugs.python.org/issue1731717
+# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717
if sys.version_info < (2, 7) and os.name != "nt":
- from subprocess import Popen
import errno
+ from subprocess import Popen
def _eintr_retry_call(func, *args):
while True:
@@ -44,13 +43,13 @@ if sys.version_info < (2, 7) and os.name != "nt":
Popen.wait = wait
if os.name != "nt":
+ from grp import getgrnam
from os import chown
from pwd import getpwnam
- from grp import getgrnam
-from module.utils import save_join, fs_encode
from module.plugins.Hook import Hook, threaded, Expose
from module.plugins.internal.AbstractExtractor import ArchiveError, CRCError, WrongPassword
+from module.utils import save_join, fs_encode
class ExtractArchive(Hook):
@@ -58,8 +57,9 @@ class ExtractArchive(Hook):
Provides: unrarFinished (folder, filename)
"""
__name__ = "ExtractArchive"
+ __type__ = "hook"
__version__ = "0.16"
- __description__ = """Extract different kind of archives"""
+
__config__ = [("activated", "bool", "Activated", True),
("fullpath", "bool", "Extract full path", True),
("overwrite", "bool", "Overwrite files", True),
@@ -71,11 +71,14 @@ class ExtractArchive(Hook):
("recursive", "bool", "Extract archives in archvies", True),
("queue", "bool", "Wait for all downloads to be finished", True),
("renice", "int", "CPU Priority", 0)]
- __author_name__ = ("pyload Team", "AndroKev")
- __author_mail__ = ("admin<at>pyload.org", "@pyloadforum")
+
+ __description__ = """Extract different kind of archives"""
+ __author_name__ = ("pyLoad Team", "AndroKev")
+ __author_mail__ = ("admin@pyload.org", "@pyloadforum")
event_list = ["allDownloadsProcessed"]
+
def setup(self):
self.plugins = []
self.passwords = []
@@ -154,12 +157,12 @@ class ExtractArchive(Hook):
#relative to package folder if destination is relative, otherwise absolute path overwrites them
if self.getConfig("subfolder"):
- out = join(out, fs_encode(p.folder))
+ out = save_join(out, fs_encode(p.folder))
if not exists(out):
makedirs(out)
- files_ids = [(save_join(dl, p.folder, x["name"]), x["id"]) for x in p.getChildren().itervalues()]
+ files_ids = [(save_join(dl, p.folder, x['name']), x['id']) for x in p.getChildren().itervalues()]
matched = False
# check as long there are unseen files
@@ -303,15 +306,15 @@ class ExtractArchive(Hook):
if not exists(f):
continue
try:
- if self.config["permission"]["change_file"]:
+ if self.config['permission']['change_file']:
if isfile(f):
- chmod(f, int(self.config["permission"]["file"], 8))
+ chmod(f, int(self.config['permission']['file'], 8))
elif isdir(f):
- chmod(f, int(self.config["permission"]["folder"], 8))
+ chmod(f, int(self.config['permission']['folder'], 8))
- if self.config["permission"]["change_dl"] and os.name != "nt":
- uid = getpwnam(self.config["permission"]["user"])[2]
- gid = getgrnam(self.config["permission"]["group"])[2]
+ if self.config['permission']['change_dl'] and os.name != "nt":
+ uid = getpwnam(self.config['permission']['user'])[2]
+ gid = getgrnam(self.config['permission']['group'])[2]
chown(f, uid, gid)
except Exception, e:
self.logWarning(_("Setting User and Group failed"), e)
diff --git a/module/plugins/hooks/FastixRu.py b/module/plugins/hooks/FastixRu.py
index 558da1b86..879dba277 100644
--- a/module/plugins/hooks/FastixRu.py
+++ b/module/plugins/hooks/FastixRu.py
@@ -1,24 +1,25 @@
# -*- coding: utf-8 -*-
-# should be working
-
+from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
-from module.common.json_layer import json_loads
class FastixRu(MultiHoster):
__name__ = "FastixRu"
- __version__ = "0.02"
__type__ = "hook"
+ __version__ = "0.02"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("unloadFailing", "bool", "Revert to standard download if download fails", False),
("interval", "int", "Reload interval in hours (0 to disable)", 24)]
+
__description__ = """Fastix.ru hook plugin"""
__author_name__ = "Massimo Rosamilia"
__author_mail__ = "max@spiritix.eu"
+
def getHoster(self):
page = getURL(
"http://fastix.ru/api_v2/?apikey=5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y&sub=allowed_sources")
diff --git a/module/plugins/hooks/FreeWayMe.py b/module/plugins/hooks/FreeWayMe.py
index 7d4bcc852..12d58ac8a 100644
--- a/module/plugins/hooks/FreeWayMe.py
+++ b/module/plugins/hooks/FreeWayMe.py
@@ -1,39 +1,25 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Nicolas Giese
-"""
-
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
class FreeWayMe(MultiHoster):
__name__ = "FreeWayMe"
- __version__ = "0.11"
__type__ = "hook"
- __description__ = """FreeWay.me hook plugin"""
+ __version__ = "0.11"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
("unloadFailing", "bool", "Revert to stanard download if download fails", False),
("interval", "int", "Reload interval in hours (0 to disable)", 24)]
+
+ __description__ = """FreeWay.me hook plugin"""
__author_name__ = "Nicolas Giese"
__author_mail__ = "james@free-way.me"
+
def getHoster(self):
hostis = getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip()
self.logDebug("hosters: %s" % hostis)
diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py
index a63b314d1..4c81292e3 100644
--- a/module/plugins/hooks/HotFolder.py
+++ b/module/plugins/hooks/HotFolder.py
@@ -1,51 +1,34 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
- @interface-version: 0.2
-"""
-
-from os import makedirs
-from os import listdir
-from os.path import exists
-from os.path import join
-from os.path import isfile
-from shutil import move
import time
+from os import listdir, makedirs
+from os.path import exists, isfile, join
+from shutil import move
+
from module.plugins.Hook import Hook
class HotFolder(Hook):
__name__ = "HotFolder"
+ __type__ = "hook"
__version__ = "0.11"
- __description__ = """Observe folder and file for changes and add container and links"""
+
__config__ = [("activated", "bool", "Activated", False),
("folder", "str", "Folder to observe", "container"),
("watch_file", "bool", "Observe link file", False),
("keep", "bool", "Keep added containers", True),
("file", "str", "Link file", "links.txt")]
+
+ __description__ = """Observe folder and file for changes and add container and links"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.de"
+
def setup(self):
self.interval = 10
def periodical(self):
-
if not exists(join(self.getConfig("folder"), "finished")):
makedirs(join(self.getConfig("folder"), "finished"))
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py
index 760c1a4df..7ebc0275f 100644
--- a/module/plugins/hooks/IRCInterface.py
+++ b/module/plugins/hooks/IRCInterface.py
@@ -1,43 +1,26 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
- @author: jeix
- @interface-version: 0.2
-"""
+import re
+import socket
+import time
+from pycurl import FORM_FILE
from select import select
-import socket
from threading import Thread
-import time
from time import sleep
from traceback import print_exc
-import re
-from pycurl import FORM_FILE
-from module.plugins.Hook import Hook
+from module.Api import PackageDoesNotExists, FileDoesNotExists
from module.network.RequestFactory import getURL
+from module.plugins.Hook import Hook
from module.utils import formatSize
-from module.Api import PackageDoesNotExists, FileDoesNotExists
class IRCInterface(Thread, Hook):
__name__ = "IRCInterface"
+ __type__ = "hook"
__version__ = "0.11"
- __description__ = """Connect to irc and let owner perform different tasks"""
+
__config__ = [("activated", "bool", "Activated", False),
("host", "str", "IRC-Server Address", "Enter your server here!"),
("port", "int", "IRC-Server Port", 6667),
@@ -48,9 +31,12 @@ class IRCInterface(Thread, Hook):
("info_file", "bool", "Inform about every file finished", False),
("info_pack", "bool", "Inform about every package finished", True),
("captcha", "bool", "Send captcha requests", True)]
+
+ __description__ = """Connect to irc and let owner perform different tasks"""
__author_name__ = "Jeix"
__author_mail__ = "Jeix@hasnomail.com"
+
def __init__(self, core, manager):
Thread.__init__(self)
Hook.__init__(self, core, manager)
@@ -59,12 +45,9 @@ class IRCInterface(Thread, Hook):
self.api = core.api # todo, only use api
def coreReady(self):
- self.new_package = {}
-
self.abort = False
-
- self.links_added = 0
self.more = []
+ self.new_package = {}
self.start()
@@ -155,25 +138,25 @@ class IRCInterface(Thread, Hook):
self.handle_events(msg)
def handle_events(self, msg):
- if not msg["origin"].split("!", 1)[0] in self.getConfig("owner").split():
+ if not msg['origin'].split("!", 1)[0] in self.getConfig("owner").split():
return
- if msg["target"].split("!", 1)[0] != self.getConfig("nick"):
+ if msg['target'].split("!", 1)[0] != self.getConfig("nick"):
return
- if msg["action"] != "PRIVMSG":
+ if msg['action'] != "PRIVMSG":
return
# HANDLE CTCP ANTI FLOOD/BOT PROTECTION
- if msg["text"] == "\x01VERSION\x01":
+ if msg['text'] == "\x01VERSION\x01":
self.logDebug("Sending CTCP VERSION.")
self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface"))
return
- elif msg["text"] == "\x01TIME\x01":
+ elif msg['text'] == "\x01TIME\x01":
self.logDebug("Sending CTCP TIME.")
self.sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time()))
return
- elif msg["text"] == "\x01LAG\x01":
+ elif msg['text'] == "\x01LAG\x01":
self.logDebug("Received CTCP LAG.") # don't know how to answer
return
@@ -181,7 +164,7 @@ class IRCInterface(Thread, Hook):
args = None
try:
- temp = msg["text"].split()
+ temp = msg['text'].split()
trigger = temp[0]
if len(temp) > 1:
args = temp[1:]
@@ -192,7 +175,7 @@ class IRCInterface(Thread, Hook):
try:
res = handler(args)
for line in res:
- self.response(line, msg["origin"])
+ self.response(line, msg['origin'])
except Exception, e:
self.logError("pyLoad IRC: " + repr(e))
@@ -258,7 +241,7 @@ class IRCInterface(Thread, Hook):
def event_info(self, args):
if not args:
- return ['ERROR: Use info like this: info <id>']
+ return ["ERROR: Use info like this: info <id>"]
info = None
try:
@@ -271,7 +254,7 @@ class IRCInterface(Thread, Hook):
def event_packinfo(self, args):
if not args:
- return ['ERROR: Use packinfo like this: packinfo <id>']
+ return ["ERROR: Use packinfo like this: packinfo <id>"]
lines = []
pack = None
@@ -311,19 +294,17 @@ class IRCInterface(Thread, Hook):
return lines
def event_start(self, args):
-
self.api.unpauseServer()
return ["INFO: Starting downloads."]
def event_stop(self, args):
-
self.api.pauseServer()
return ["INFO: No new downloads will be started."]
def event_add(self, args):
if len(args) < 2:
return ['ERROR: Add links like this: "add <packagename|id> links". ',
- 'This will add the link <link> to to the package <package> / the package with id <id>!']
+ "This will add the link <link> to to the package <package> / the package with id <id>!"]
pack = args[0].strip()
links = [x.strip() for x in args[1:]]
@@ -338,7 +319,7 @@ class IRCInterface(Thread, Hook):
#TODO add links
- return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack["name"], id)]
+ return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)]
except:
# create new package
@@ -415,6 +396,7 @@ class IRCInterface(Thread, Hook):
class IRCError(Exception):
+
def __init__(self, value):
self.value = value
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index e2e9d93d5..d9d4e547e 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -1,32 +1,19 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay, RaNaN, zoidberg
-"""
from __future__ import with_statement
-from thread import start_new_thread
-from pycurl import FORM_FILE, LOW_SPEED_TIME
+
import re
+
from base64 import b64encode
+from pycurl import FORM_FILE, LOW_SPEED_TIME
+from thread import start_new_thread
from module.network.RequestFactory import getURL, getRequest
from module.plugins.Hook import Hook
class ImageTyperzException(Exception):
+
def __init__(self, err):
self.err = err
@@ -42,12 +29,15 @@ class ImageTyperzException(Exception):
class ImageTyperz(Hook):
__name__ = "ImageTyperz"
+ __type__ = "hook"
__version__ = "0.04"
- __description__ = """Send captchas to ImageTyperz.com"""
+
__config__ = [("activated", "bool", "Activated", False),
("username", "str", "Username", ""),
("passkey", "password", "Password", ""),
("force", "bool", "Force IT even if client is connected", False)]
+
+ __description__ = """Send captchas to ImageTyperz.com"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
@@ -55,6 +45,7 @@ class ImageTyperz(Hook):
RESPOND_URL = "http://captchatypers.com/Forms/SetBadImage.ashx"
GETCREDITS_URL = "http://captchatypers.com/Forms/RequestBalance.ashx"
+
def setup(self):
self.info = {}
@@ -79,7 +70,7 @@ class ImageTyperz(Hook):
req.c.setopt(LOW_SPEED_TIME, 80)
try:
- #workaround multipart-post bug in HTTPRequest.py
+ #workaround multipart-post bug in HTTPRequest.py
if re.match("^[A-Za-z0-9]*$", self.getConfig("passkey")):
multipart = True
data = (FORM_FILE, captcha)
@@ -133,7 +124,7 @@ class ImageTyperz(Hook):
if task.data['service'] == self.__name__ and "ticket" in task.data:
response = getURL(self.RESPOND_URL, post={"action": "SETBADIMAGE", "username": self.getConfig("username"),
"password": self.getConfig("passkey"),
- "imageid": task.data["ticket"]})
+ "imageid": task.data['ticket']})
if response == "SUCCESS":
self.logInfo("Bad captcha solution received, requested refund")
@@ -148,5 +139,5 @@ class ImageTyperz(Hook):
task.error = e.getCode()
return
- task.data["ticket"] = ticket
+ task.data['ticket'] = ticket
task.setResult(result)
diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py
index dd9cd79f2..1aa8f7ca1 100644
--- a/module/plugins/hooks/LinkdecrypterCom.py
+++ b/module/plugins/hooks/LinkdecrypterCom.py
@@ -1,37 +1,24 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.Hook import Hook
from module.network.RequestFactory import getURL
+from module.plugins.Hook import Hook
from module.utils import remove_chars
class LinkdecrypterCom(Hook):
__name__ = "LinkdecrypterCom"
+ __type__ = "hook"
__version__ = "0.19"
- __description__ = """Linkdecrypter.com hook plugin"""
+
__config__ = [("activated", "bool", "Activated", False)]
+
+ __description__ = """Linkdecrypter.com hook plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def coreReady(self):
try:
self.loadPatterns()
@@ -41,12 +28,12 @@ class LinkdecrypterCom(Hook):
def loadPatterns(self):
page = getURL("http://linkdecrypter.com/")
m = re.search(r'<b>Supported\(\d+\)</b>: <i>([^+<]*)', page)
- if not m:
+ if m is None:
self.logError(_("Crypter list not found"))
return
builtin = [name.lower() for name in self.core.pluginManager.crypterPlugins.keys()]
- builtin.extend(["downloadserienjunkiesorg"])
+ builtin.append("downloadserienjunkiesorg")
crypter_pattern = re.compile("(\w[\w.-]+)")
online = []
@@ -62,7 +49,7 @@ class LinkdecrypterCom(Hook):
regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online)
dict = self.core.pluginManager.crypterPlugins[self.__name__]
- dict["pattern"] = regexp
- dict["re"] = re.compile(regexp)
+ dict['pattern'] = regexp
+ dict['re'] = re.compile(regexp)
self.logDebug("REGEXP: " + regexp)
diff --git a/module/plugins/hooks/LinksnappyCom.py b/module/plugins/hooks/LinksnappyCom.py
index 110731228..20da68632 100644
--- a/module/plugins/hooks/LinksnappyCom.py
+++ b/module/plugins/hooks/LinksnappyCom.py
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.MultiHoster import MultiHoster
-from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class LinksnappyCom(MultiHoster):
__name__ = "LinksnappyCom"
- __version__ = "0.01"
__type__ = "hook"
+ __version__ = "0.01"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
@@ -19,6 +20,7 @@ class LinksnappyCom(MultiHoster):
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def getHoster(self):
json_data = getURL('http://gen.linksnappy.com/lseAPI.php?act=FILEHOSTS')
json_data = json_loads(json_data)
diff --git a/module/plugins/hooks/MegaDebridEu.py b/module/plugins/hooks/MegaDebridEu.py
index 0c3bb99f6..605b04f21 100644
--- a/module/plugins/hooks/MegaDebridEu.py
+++ b/module/plugins/hooks/MegaDebridEu.py
@@ -1,39 +1,28 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-from module.plugins.internal.MultiHoster import MultiHoster
-from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class MegaDebridEu(MultiHoster):
__name__ = "MegaDebridEu"
- __version__ = "0.02"
__type__ = "hook"
+ __version__ = "0.02"
+
__config__ = [("activated", "bool", "Activated", False),
("unloadFailing", "bool", "Revert to standard download if download fails", False)]
+
__description__ = """mega-debrid.eu hook plugin"""
__author_name__ = "D.Ducatel"
__author_mail__ = "dducatel@je-geek.fr"
+
def getHoster(self):
reponse = getURL('http://www.mega-debrid.eu/api.php?action=getHosters')
json_data = json_loads(reponse)
- if json_data["response_code"] == "ok":
+ if json_data['response_code'] == "ok":
host_list = [element[0] for element in json_data['hosters']]
else:
self.logError("Unable to retrieve hoster list")
diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py
index 99b0aafc6..a859092fb 100644
--- a/module/plugins/hooks/MergeFiles.py
+++ b/module/plugins/hooks/MergeFiles.py
@@ -1,56 +1,42 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: and9000
-"""
-
import os
import re
import traceback
-from os.path import join
+from module.plugins.Hook import Hook, threaded
from module.utils import save_join, fs_encode
-from module.plugins.Hook import Hook
-
-BUFFER_SIZE = 4096
class MergeFiles(Hook):
__name__ = "MergeFiles"
+ __type__ = "hook"
__version__ = "0.12"
- __description__ = """Merges parts splitted with hjsplit"""
+
__config__ = [("activated", "bool", "Activated", False)]
- __threaded__ = ["packageFinished"]
+
+ __description__ = """Merges parts splitted with hjsplit"""
__author_name__ = "and9000"
__author_mail__ = "me@has-no-mail.com"
+ BUFFER_SIZE = 4096
+
+
def setup(self):
# nothing to do
pass
+ @threaded
def packageFinished(self, pack):
files = {}
fid_dict = {}
for fid, data in pack.getChildren().iteritems():
- if re.search("\.[0-9]{3}$", data["name"]):
- if data["name"][:-4] not in files:
- files[data["name"][:-4]] = []
- files[data["name"][:-4]].append(data["name"])
- files[data["name"][:-4]].sort()
- fid_dict[data["name"]] = fid
+ if re.search("\.[0-9]{3}$", data['name']):
+ if data['name'][:-4] not in files:
+ files[data['name'][:-4]] = []
+ files[data['name'][:-4]].append(data['name'])
+ files[data['name'][:-4]].sort()
+ fid_dict[data['name']] = fid
download_folder = self.config['general']['download_folder']
@@ -59,7 +45,7 @@ class MergeFiles(Hook):
for name, file_list in files.iteritems():
self.logInfo("Starting merging of %s" % name)
- final_file = open(join(download_folder, fs_encode(name)), "wb")
+ final_file = open(save_join(download_folder, name), "wb")
for splitted_file in file_list:
self.logDebug("Merging part %s" % splitted_file)
@@ -70,10 +56,10 @@ class MergeFiles(Hook):
size_written = 0
s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file)))
while True:
- f_buffer = s_file.read(BUFFER_SIZE)
+ f_buffer = s_file.read(self.BUFFER_SIZE)
if f_buffer:
final_file.write(f_buffer)
- size_written += BUFFER_SIZE
+ size_written += self.BUFFER_SIZE
pyfile.setProgress((size_written * 100) / s_file_size)
else:
break
diff --git a/module/plugins/hooks/MultiDebridCom.py b/module/plugins/hooks/MultiDebridCom.py
index f2dfb18ca..c5d1464f8 100644
--- a/module/plugins/hooks/MultiDebridCom.py
+++ b/module/plugins/hooks/MultiDebridCom.py
@@ -1,28 +1,15 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-from module.plugins.internal.MultiHoster import MultiHoster
-from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class MultiDebridCom(MultiHoster):
__name__ = "MultiDebridCom"
- __version__ = "0.01"
__type__ = "hook"
+ __version__ = "0.01"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
@@ -33,6 +20,7 @@ class MultiDebridCom(MultiHoster):
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def getHoster(self):
json_data = getURL('http://multi-debrid.com/api.php?hosts', decode=True)
self.logDebug('JSON data: ' + json_data)
diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py
index b1635a588..e2167b65e 100644
--- a/module/plugins/hooks/MultiHome.py
+++ b/module/plugins/hooks/MultiHome.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: mkaay
-"""
-
from time import time
from module.plugins.Hook import Hook
@@ -24,19 +7,23 @@ from module.plugins.Hook import Hook
class MultiHome(Hook):
__name__ = "MultiHome"
+ __type__ = "hook"
__version__ = "0.11"
- __description__ = """Ip address changer"""
+
__config__ = [("activated", "bool", "Activated", False),
("interfaces", "str", "Interfaces", "None")]
+
+ __description__ = """Ip address changer"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
+
def setup(self):
self.register = {}
self.interfaces = []
self.parseInterfaces(self.getConfig("interfaces").split(";"))
if not self.interfaces:
- self.parseInterfaces([self.config["download"]["interface"]])
+ self.parseInterfaces([self.config['download']['interface']])
self.setConfig("interfaces", self.toConfig())
def toConfig(self):
@@ -71,6 +58,7 @@ class MultiHome(Hook):
class Interface(object):
+
def __init__(self, adress):
self.adress = adress
self.history = {}
diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py
index 0291738f5..9249106d6 100644
--- a/module/plugins/hooks/MultishareCz.py
+++ b/module/plugins/hooks/MultishareCz.py
@@ -8,17 +8,20 @@ from module.plugins.internal.MultiHoster import MultiHoster
class MultishareCz(MultiHoster):
__name__ = "MultishareCz"
- __version__ = "0.04"
__type__ = "hook"
+ __version__ = "0.04"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", "uloz.to")]
+
__description__ = """MultiShare.cz hook plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="([^"]+)"></td>\s*<td class="stav">[^>]*?alt="OK"'
+
def getHoster(self):
page = getURL("http://www.multishare.cz/monitoring/")
return re.findall(self.HOSTER_PATTERN, page)
diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py
index e15d0b05f..5be0b8482 100644
--- a/module/plugins/hooks/OverLoadMe.py
+++ b/module/plugins/hooks/OverLoadMe.py
@@ -6,18 +6,21 @@ from module.plugins.internal.MultiHoster import MultiHoster
class OverLoadMe(MultiHoster):
__name__ = "OverLoadMe"
- __version__ = "0.01"
__type__ = "hook"
+ __version__ = "0.01"
+
__config__ = [("activated", "bool", "Activated", False),
("https", "bool", "Enable HTTPS", True),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
("unloadFailing", "bool", "Revert to standard download if download fails", False),
("interval", "int", "Reload interval in hours (0 to disable)", 12)]
+
__description__ = """Over-Load.me hook plugin"""
__author_name__ = "marley"
__author_mail__ = "marley@over-load.me"
+
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
page = getURL(https + "://api.over-load.me/hoster.php",
diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py
index 57b188bb9..9c6701b06 100644
--- a/module/plugins/hooks/Premium4Me.py
+++ b/module/plugins/hooks/Premium4Me.py
@@ -6,16 +6,18 @@ from module.plugins.internal.MultiHoster import MultiHoster
class Premium4Me(MultiHoster):
__name__ = "Premium4Me"
- __version__ = "0.03"
__type__ = "hook"
+ __version__ = "0.03"
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"),
("hosterList", "str", "Hoster list (comma separated)", "")]
+
__description__ = """Premium.to hook plugin"""
__author_name__ = ("RaNaN", "zoidberg", "stickell")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
def getHoster(self):
page = getURL("http://premium.to/api/hosters.php?authcode=%s" % self.account.authcode)
return [x.strip() for x in page.replace("\"", "").split(";")]
diff --git a/module/plugins/hooks/PremiumizeMe.py b/module/plugins/hooks/PremiumizeMe.py
index 9f1a70a70..e7291ece9 100644
--- a/module/plugins/hooks/PremiumizeMe.py
+++ b/module/plugins/hooks/PremiumizeMe.py
@@ -1,16 +1,14 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.MultiHoster import MultiHoster
-
from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class PremiumizeMe(MultiHoster):
__name__ = "PremiumizeMe"
- __version__ = "0.12"
__type__ = "hook"
- __description__ = """Premiumize.me hook plugin"""
+ __version__ = "0.12"
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
@@ -18,9 +16,11 @@ class PremiumizeMe(MultiHoster):
("unloadFailing", "bool", "Revert to stanard download if download fails", False),
("interval", "int", "Reload interval in hours (0 to disable)", 24)]
+ __description__ = """Premiumize.me hook plugin"""
__author_name__ = "Florian Franzen"
__author_mail__ = "FlorianFranzen@gmail.com"
+
def getHoster(self):
# If no accounts are available there will be no hosters available
if not self.account or not self.account.canUse():
@@ -39,7 +39,7 @@ class PremiumizeMe(MultiHoster):
if data['status'] != 200:
return []
- # Extract hosters from json file
+ # Extract hosters from json file
return data['result']['hosterlist']
def coreReady(self):
@@ -50,5 +50,5 @@ class PremiumizeMe(MultiHoster):
self.logError(_("Please add a valid premiumize.me account first and restart pyLoad."))
return
- # Run the overwriten core ready which actually enables the multihoster hook
+ # Run the overwriten core ready which actually enables the multihoster hook
return MultiHoster.coreReady(self)
diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py
index 54f814231..9b9b7cda9 100644
--- a/module/plugins/hooks/RPNetBiz.py
+++ b/module/plugins/hooks/RPNetBiz.py
@@ -1,23 +1,26 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.MultiHoster import MultiHoster
from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class RPNetBiz(MultiHoster):
__name__ = "RPNetBiz"
- __version__ = "0.1"
__type__ = "hook"
- __description__ = """RPNet.biz hook plugin"""
+ __version__ = "0.1"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
("unloadFailing", "bool", "Revert to stanard download if download fails", False),
("interval", "int", "Reload interval in hours (0 to disable)", 24)]
+
+ __description__ = """RPNet.biz hook plugin"""
__author_name__ = "Dman"
__author_mail__ = "dmanugm@gmail.com"
+
def getHoster(self):
# No hosts supported if no account
if not self.account or not self.account.canUse():
@@ -34,7 +37,7 @@ class RPNetBiz(MultiHoster):
if 'error' in hoster_list:
return []
- # Extract hosters from json file
+ # Extract hosters from json file
return hoster_list['hosters']
def coreReady(self):
@@ -45,5 +48,5 @@ class RPNetBiz(MultiHoster):
self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet")
return
- # Run the overwriten core ready which actually enables the multihoster hook
+ # Run the overwriten core ready which actually enables the multihoster hook
return MultiHoster.coreReady(self)
diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py
index 566f9005f..87902ac7f 100644
--- a/module/plugins/hooks/RealdebridCom.py
+++ b/module/plugins/hooks/RealdebridCom.py
@@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster
class RealdebridCom(MultiHoster):
__name__ = "RealdebridCom"
- __version__ = "0.43"
__type__ = "hook"
+ __version__ = "0.43"
__config__ = [("activated", "bool", "Activated", False),
("https", "bool", "Enable HTTPS", False),
@@ -15,10 +15,12 @@ class RealdebridCom(MultiHoster):
("hosterList", "str", "Hoster list (comma separated)", ""),
("unloadFailing", "bool", "Revert to stanard download if download fails", False),
("interval", "int", "Reload interval in hours (0 to disable)", 24)]
+
__description__ = """Real-Debrid.com hook plugin"""
__author_name__ = "Devirex Hazzard"
__author_mail__ = "naibaf_11@yahoo.de"
+
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
page = getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip()
diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py
index 6c3a77ca3..d504bb83b 100644
--- a/module/plugins/hooks/RehostTo.py
+++ b/module/plugins/hooks/RehostTo.py
@@ -6,8 +6,8 @@ from module.plugins.internal.MultiHoster import MultiHoster
class RehostTo(MultiHoster):
__name__ = "RehostTo"
- __version__ = "0.43"
__type__ = "hook"
+ __version__ = "0.43"
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
@@ -19,6 +19,7 @@ class RehostTo(MultiHoster):
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def getHoster(self):
page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses)
return [x.strip() for x in page.replace("\"", "").split(",")]
@@ -33,7 +34,7 @@ class RehostTo(MultiHoster):
return
data = self.account.getAccountInfo(user)
- self.ses = data["ses"]
- self.long_ses = data["long_ses"]
+ self.ses = data['ses']
+ self.long_ses = data['long_ses']
return MultiHoster.coreReady(self)
diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py
deleted file mode 100644
index 9960a2699..000000000
--- a/module/plugins/hooks/ReloadCc.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.internal.MultiHoster import MultiHoster
-
-from module.common.json_layer import json_loads
-from module.network.RequestFactory import getURL
-
-
-class ReloadCc(MultiHoster):
- __name__ = "ReloadCc"
- __version__ = "0.3"
- __type__ = "hook"
- __description__ = """Reload.cc hook plugin"""
-
- __config__ = [("activated", "bool", "Activated", False),
- ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
- ("hosterList", "str", "Hoster list (comma separated)", "")]
-
- __author_name__ = "Reload Team"
- __author_mail__ = "hello@reload.cc"
-
- interval = 0 # Disable periodic calls
-
- def getHoster(self):
- # If no accounts are available there will be no hosters available
- if not self.account or not self.account.canUse():
- print "ReloadCc: No accounts available"
- return []
-
- # Get account data
- (user, data) = self.account.selectAccount()
-
- # Get supported hosters list from reload.cc using the json API v1
- query_params = dict(
- via='pyload',
- v=1,
- get_supported='true',
- get_traffic='true',
- user=user
- )
-
- try:
- query_params.update(dict(hash=self.account.infos[user]['pwdhash']))
- except Exception:
- query_params.update(dict(pwd=data['password']))
-
- answer = getURL("http://api.reload.cc/login", get=query_params)
- data = json_loads(answer)
-
- # If account is not valid thera are no hosters available
- if data['status'] != "ok":
- print "ReloadCc: Status is not ok: %s" % data['status']
- return []
-
- # Extract hosters from json file
- return data['msg']['supportedHosters']
-
- def coreReady(self):
- # Get account plugin and check if there is a valid account available
- self.account = self.core.accountManager.getAccountPlugin("ReloadCc")
- if not self.account.canUse():
- self.account = None
- self.logError("Please add a valid reload.cc account first and restart pyLoad.")
- return
-
- # Run the overwriten core ready which actually enables the multihoster hook
- return MultiHoster.coreReady(self)
diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py
index 85553d738..3aef6f8cd 100644
--- a/module/plugins/hooks/RestartFailed.py
+++ b/module/plugins/hooks/RestartFailed.py
@@ -1,57 +1,42 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Walter Purcaro
-"""
-
from module.plugins.Hook import Hook
class RestartFailed(Hook):
__name__ = "RestartFailed"
- __version__ = "1.53"
- __description__ = """Periodically restart all failed downloads in queue"""
+ __type__ = "hook"
+ __version__ = "1.55"
+
__config__ = [("activated", "bool", "Activated", False),
- ("interval", "int", "Interval in minutes", 90)]
+ ("interval", "int", "Check interval in minutes", 90)]
+
+ __description__ = """Periodically restart all failed downloads in queue"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
- event_list = ["pluginConfigChanged"]
-
- MIN_INTERVAL = 15 * 60 # seconds
+ MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds)
- def periodical(self):
- self.logDebug("Restart all failed downloads now")
- self.core.api.restartFailed()
+ event_list = ["pluginConfigChanged"]
- def restartPeriodical(self, interval):
- self.logDebug("Set periodical interval to %s seconds" % interval)
- if self.cb:
- self.core.scheduler.removeJob(self.cb)
- self.interval = interval
- self.cb = self.core.scheduler.addJob(interval, self._periodical, threaded=False)
def pluginConfigChanged(self, plugin, name, value):
- value *= 60
if name == "interval":
- if self.interval != value > self.MIN_INTERVAL:
- self.restartPeriodical(value)
+ interval = value * 60
+ if self.MIN_INTERVAL <= interval != self.interval:
+ self.core.scheduler.removeJob(self.cb)
+ self.interval = interval
+ self.initPeriodical()
else:
- self.logWarning("Cannot change interval: given value is equal to the current or \
- smaller than %s seconds" % self.MIN_INTERVAL)
+ self.logDebug("Invalid interval value, kept current")
+
+ def periodical(self):
+ self.logInfo("Restart failed downloads")
+ self.api.restartFailed()
+
+ def setup(self):
+ self.api = self.core.api
+ self.interval = self.MIN_INTERVAL
def coreReady(self):
- self.pluginConfigChanged(plugin="RestartFailed", name="interval", value=self.getConfig("interval"))
+ self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval"))
diff --git a/module/plugins/hooks/SimplyPremiumCom.py b/module/plugins/hooks/SimplyPremiumCom.py
index 60d164c66..a946d391e 100644
--- a/module/plugins/hooks/SimplyPremiumCom.py
+++ b/module/plugins/hooks/SimplyPremiumCom.py
@@ -1,38 +1,26 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-from module.plugins.internal.MultiHoster import MultiHoster
-from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class SimplyPremiumCom(MultiHoster):
__name__ = "SimplyPremiumCom"
- __version__ = "0.02"
__type__ = "hook"
+ __version__ = "0.02"
+
__config__ = [("activated", "bool", "Activated", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
("unloadFailing", "bool", "Revert to standard download if download fails", "False"),
("interval", "int", "Reload interval in hours (0 to disable)", "24")]
- __description__ = """Simply-Premium.Com hook plugin"""
+
+ __description__ = """Simply-Premium.com hook plugin"""
__author_name__ = "EvolutionClip"
__author_mail__ = "evolutionclip@live.de"
+
def getHoster(self):
json_data = getURL('http://www.simply-premium.com/api/hosts.php?format=json&online=1')
json_data = json_loads(json_data)
diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py
index a523d2404..ab13f312e 100644
--- a/module/plugins/hooks/SimplydebridCom.py
+++ b/module/plugins/hooks/SimplydebridCom.py
@@ -6,15 +6,18 @@ from module.plugins.internal.MultiHoster import MultiHoster
class SimplydebridCom(MultiHoster):
__name__ = "SimplydebridCom"
- __version__ = "0.01"
__type__ = "hook"
+ __version__ = "0.01"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", "")]
+
__description__ = """Simply-Debrid.com hook plugin"""
__author_name__ = "Kagenoshin"
__author_mail__ = "kagenoshin@gmx.ch"
+
def getHoster(self):
page = getURL("http://simply-debrid.com/api.php?list=1")
return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")]
diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py
index af6039ecd..f25c5e2b4 100644
--- a/module/plugins/hooks/UnSkipOnFail.py
+++ b/module/plugins/hooks/UnSkipOnFail.py
@@ -1,35 +1,23 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: hgg
-"""
from os.path import basename
-from module.utils import fs_encode
-from module.plugins.Hook import Hook
from module.PyFile import PyFile
+from module.plugins.Hook import Hook
+from module.utils import fs_encode
class UnSkipOnFail(Hook):
- __name__ = 'UnSkipOnFail'
- __version__ = '0.01'
- __description__ = """When a download fails, restart skipped duplicates"""
+ __name__ = "UnSkipOnFail"
+ __type__ = "hook"
+ __version__ = "0.01"
+
__config__ = [("activated", "bool", "Activated", True)]
+
+ __description__ = """When a download fails, restart skipped duplicates"""
__author_name__ = "hagg"
- __author_mail__ = ""
+ __author_mail__ = None
+
def downloadFailed(self, pyfile):
pyfile_name = basename(pyfile.name)
diff --git a/module/plugins/hooks/UnrestrictLi.py b/module/plugins/hooks/UnrestrictLi.py
index 4f8f11625..ee5d79269 100644
--- a/module/plugins/hooks/UnrestrictLi.py
+++ b/module/plugins/hooks/UnrestrictLi.py
@@ -1,28 +1,15 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-from module.plugins.internal.MultiHoster import MultiHoster
-from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
+from module.network.RequestFactory import getURL
+from module.plugins.internal.MultiHoster import MultiHoster
class UnrestrictLi(MultiHoster):
__name__ = "UnrestrictLi"
- __version__ = "0.02"
__type__ = "hook"
+ __version__ = "0.02"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", ""),
@@ -34,6 +21,7 @@ class UnrestrictLi(MultiHoster):
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def getHoster(self):
json_data = getURL('http://unrestrict.li/api/jdownloader/hosts.php?format=json')
json_data = json_loads(json_data)
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 9f8ccdb80..546e6e6e8 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -1,67 +1,81 @@
# -*- coding: utf-8 -*-
-import sys
import re
+import sys
-from os import remove, stat
-from os.path import join, isfile
-from time import time
+from operator import itemgetter
+from os import path, remove, stat
-from module.ConfigParser import IGNORE
from module.network.RequestFactory import getURL
-from module.plugins.Hook import threaded, Expose, Hook
+from module.plugins.Hook import Expose, Hook, threaded
+from module.utils import save_join
class UpdateManager(Hook):
__name__ = "UpdateManager"
- __version__ = "0.24"
- __description__ = """Check for updates"""
+ __type__ = "hook"
+ __version__ = "0.35"
+
__config__ = [("activated", "bool", "Activated", True),
("mode", "pyLoad + plugins;plugins only", "Check updates for", "pyLoad + plugins"),
("interval", "int", "Check interval in hours", 8),
("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True),
("nodebugupdate", "bool", "Don't check for updates in debug mode", True)]
- __author_name__ = ("RaNaN", "stickell", "Walter Purcaro")
- __author_mail__ = ("ranan@pyload.org", "l.stickell@yahoo.it", "vuolter@gmail.com")
- SERVER_URL = "http://updatemanager.pyload.org"
- MIN_TIME = 3 * 60 * 60 #: 3h minimum check interval
+ __description__ = """ Check for updates """
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
+
event_list = ["pluginConfigChanged"]
+ SERVER_URL = "http://updatemanager.pyload.org"
+ MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds)
+
def pluginConfigChanged(self, plugin, name, value):
- if name == "interval" and 0 < value != self.interval:
- self.interval = max(value * 60 * 60, self.MIN_TIME)
- self.initPeriodical()
+ if name == "interval":
+ interval = value * 60 * 60
+ if self.MIN_INTERVAL <= interval != self.interval:
+ self.core.scheduler.removeJob(self.cb)
+ self.interval = interval
+ self.initPeriodical()
+ else:
+ self.logDebug("Invalid interval value, kept current")
elif name == "reloadplugins":
if self.cb2:
self.core.scheduler.removeJob(self.cb2)
- if value and self.core.debug:
+ if value is True and self.core.debug:
self.periodical2()
def coreReady(self):
- self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins"))
+ self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval"))
+ x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins"))
+ self.core.scheduler.addJob(10, x, threaded=False)
+
+ def unload(self):
+ self.pluginConfigChanged(self.__name__, "reloadplugins", False)
def setup(self):
self.cb2 = None
- self.interval = self.MIN_TIME
+ self.interval = self.MIN_INTERVAL
self.updating = False
- self.info = {"pyload": False, "version": None, "plugins": False}
+ self.info = {'pyload': False, 'version': None, 'plugins': False}
self.mtimes = {} #: store modification time for each plugin
-
def periodical2(self):
if not self.updating:
self.autoreloadPlugins()
- self.cb2 = self.core.scheduler.addJob(10, self.periodical2, threaded=True)
+ self.cb2 = self.core.scheduler.addJob(4, self.periodical2, threaded=False)
@Expose
def autoreloadPlugins(self):
""" reload and reindex all modified plugins """
modules = filter(
- lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith(
- "userplugins.")) and m.__name__.count(".") >= 2, sys.modules.itervalues())
+ lambda m: m and (m.__name__.startswith("module.plugins.") or
+ m.__name__.startswith("userplugins.")) and
+ m.__name__.count(".") >= 2, sys.modules.itervalues()
+ )
reloads = []
@@ -70,7 +84,7 @@ class UpdateManager(Hook):
id = (type, name)
if type in self.core.pluginManager.plugins:
f = m.__file__.replace(".pyc", ".py")
- if not isfile(f):
+ if not path.isfile(f):
continue
mtime = stat(f).st_mtime
@@ -83,18 +97,24 @@ class UpdateManager(Hook):
return True if self.core.pluginManager.reloadPlugins(reloads) else False
- @threaded
def periodical(self):
- if not self.info["pyload"] and not (self.getConfig("nodebugupdate") and self.core.debug):
- self.updating = True
- self.update(onlyplugin=True if self.getConfig("mode") == "plugins only" else False)
- self.updating = False
+ if not self.info['pyload'] and not (self.getConfig("nodebugupdate") and self.core.debug):
+ self.updateThread()
- def server_response(self):
+ def server_request(self):
try:
return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines()
except:
- self.logWarning(_("Not able to connect server to get updates"))
+ self.logWarning(_("Unable to contact server to get updates"))
+
+ @threaded
+ def updateThread(self):
+ self.updating = True
+ status = self.update(onlyplugin=self.getConfig("mode") == "plugins only")
+ if status == 2:
+ self.core.api.restart()
+ else:
+ self.updating = False
@Expose
def updatePlugins(self):
@@ -104,53 +124,54 @@ class UpdateManager(Hook):
@Expose
def update(self, onlyplugin=False):
""" check for updates """
- data = self.server_response()
+ data = self.server_request()
if not data:
- r = False
+ exitcode = 0
elif data[0] == "None":
- self.logInfo(_("No pyLoad version available"))
+ self.logInfo(_("No new pyLoad version available"))
updates = data[1:]
- r = self._updatePlugins(updates)
+ exitcode = self._updatePlugins(updates)
elif onlyplugin:
- r = False
+ exitcode = 0
else:
newversion = data[0]
self.logInfo(_("*** New pyLoad Version %s available ***") % newversion)
self.logInfo(_("*** Get it here: https://github.com/pyload/pyload/releases ***"))
- r = self.info["pyload"] = True
- self.info["version"] = newversion
- return r
+ exitcode = 3
+ self.info['pyload'] = True
+ self.info['version'] = newversion
+ return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required; 3 = No plugins updated, new pyLoad version available
def _updatePlugins(self, updates):
""" check for plugin updates """
- if self.info["plugins"]:
+ if self.info['plugins']:
return False #: plugins were already updated
updated = []
vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)')
url = updates[0]
- schema = updates[1].split("|")
- if 'BLACKLIST' in updates:
+ schema = updates[1].split('|')
+ if "BLACKLIST" in updates:
blacklist = updates[updates.index('BLACKLIST') + 1:]
updates = updates[2:updates.index('BLACKLIST')]
else:
blacklist = None
updates = updates[2:]
- for plugin in updates:
- info = dict(zip(schema, plugin.split("|")))
- filename = info["name"]
- prefix = info["type"]
- version = info["version"]
+ upgradable = sorted(map(lambda x: dict(zip(schema, x.split('|'))), updates), key=itemgetter("type", "name"))
+ for plugin in upgradable:
+ filename = plugin['name']
+ prefix = plugin['type']
+ version = plugin['version']
if filename.endswith(".pyc"):
name = filename[:filename.find("_")]
else:
name = filename.replace(".py", "")
- #TODO: obsolete in 0.5.0
+ #@TODO: obsolete after 0.4.10
if prefix.endswith("s"):
type = prefix[:-1]
else:
@@ -158,77 +179,103 @@ class UpdateManager(Hook):
plugins = getattr(self.core.pluginManager, "%sPlugins" % type)
- if name not in plugins or name in IGNORE or (type, name) in IGNORE:
- continue
-
- oldver = float(plugins[name]["v"])
+ oldver = float(plugins[name]['v']) if name in plugins else None
newver = float(version)
- if oldver >= newver:
- continue
+ if not oldver:
+ msg = "New [%(type)s] %(name)s (v%(newver)s)"
+ elif newver > oldver:
+ msg = "New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)"
else:
- self.logInfo(_("New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)") % {
- "type": type,
- "name": name,
- "oldver": oldver,
- "newver": newver
- })
+ continue
+
+ self.logInfo(_(msg) % {
+ 'type': type,
+ 'name': name,
+ 'oldver': oldver,
+ 'newver': newver,
+ })
try:
- content = getURL(url % info)
+ content = getURL(url % plugin)
+ m = vre.search(content)
+ if m and m.group(2) == version:
+ f = open(save_join("userplugins", prefix, filename), "wb")
+ f.write(content)
+ f.close()
+ updated.append((prefix, name))
+ else:
+ raise Exception, _("Version mismatch")
except Exception, e:
- self.logError(_("Error when updating plugin %s") % filename, str(e))
- continue
+ self.logError(_("Error updating plugin %s") % filename, str(e))
- m = vre.search(content)
- if not m or m.group(2) != version:
- self.logError(_("Error when updating plugin %s") % name, _("Version mismatch"))
- continue
+ if blacklist:
+ blacklisted = sorted(map(lambda x: (x.split('|')[0], x.split('|')[1].rsplit('.', 1)[0]), blacklist))
- f = open(join("userplugins", prefix, filename), "wb")
- f.write(content)
- f.close()
- updated.append((prefix, name))
+ # Always protect UpdateManager from self-removing
+ try:
+ blacklisted.remove(("hook", "UpdateManager"))
+ except:
+ pass
- if blacklist:
- removed = self.removePlugins(map(lambda x: x.split('|'), blacklist))
+ removed = self.removePlugins(blacklisted)
for t, n in removed:
- self.logInfo(_("Removed blacklisted plugin: [%(type)s] %(name)s") % {
- "type": t,
- "name": n
+ self.logInfo(_("Removed blacklisted plugin [%(type)s] %(name)s") % {
+ 'type': t,
+ 'name': n,
})
if updated:
reloaded = self.core.pluginManager.reloadPlugins(updated)
if reloaded:
self.logInfo(_("Plugins updated and reloaded"))
+ exitcode = 1
else:
- self.logInfo(_("*** Plugins have been updated, pyLoad will be restarted now ***"))
- self.info["plugins"] = True
- self.core.scheduler.addJob(4, self.core.api.restart(), threaded=False) #: risky, but pyload doesn't let more
- return True
+ self.logInfo(_("*** Plugins have been updated, but need a pyLoad restart to be reloaded ***"))
+ self.info['plugins'] = True
+ exitcode = 2
else:
self.logInfo(_("No plugin updates available"))
- return False
+ exitcode = 0
+
+ return exitcode #: 0 = No plugins updated; 1 = Plugins updated; 2 = Plugins updated, but restart required
@Expose
def removePlugins(self, type_plugins):
- """ delete plugins under userplugins directory"""
+ """ delete plugins from disk """
+
if not type_plugins:
- return None
+ return
self.logDebug("Request deletion of plugins: %s" % type_plugins)
removed = []
for type, name in type_plugins:
- py = join("userplugins", type, name)
- pyc = join("userplugins", type, name.replace('.py', '.pyc'))
- if isfile(py):
+ err = False
+ file = name + ".py"
+
+ for root in ("userplugins", path.join(pypath, "module", "plugins")):
+
+ filename = save_join(root, type, file)
+ try:
+ remove(filename)
+ except Exception, e:
+ self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e))
+ err = True
+
+ filename += "c"
+ if path.isfile(filename):
+ try:
+ if type == "hook":
+ self.manager.deactivateHook(name)
+ remove(filename)
+ except Exception, e:
+ self.logDebug("Error deleting \"%s\"" % path.basename(filename), str(e))
+ err = True
+
+ if not err:
id = (type, name)
- remove(py)
removed.append(id)
- if isfile(pyc):
- remove(pyc)
return removed #: return a list of the plugins successfully removed
diff --git a/module/plugins/hooks/Vipleech4uCom.py b/module/plugins/hooks/Vipleech4uCom.py
deleted file mode 100644
index b2156b017..000000000
--- a/module/plugins/hooks/Vipleech4uCom.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- coding: utf-8 -*-
-import re
-
-from module.network.RequestFactory import getURL
-from module.plugins.internal.MultiHoster import MultiHoster
-
-
-class Vipleech4uCom(MultiHoster):
- __name__ = "Vipleech4uCom"
- __version__ = "0.01"
- __type__ = "hook"
- __config__ = [("activated", "bool", "Activated", "False"),
- ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
- ("hosterList", "str", "Hoster list (comma separated)", "")]
- __description__ = """Vipleech4u.com hook plugin"""
- __author_name__ = ("Kagenoshin")
- __author_mail__ = ("kagenoshin@gmx.ch")
-
- HOSTER_PATTERN = re.compile(r'align\s*?=\s*?["\']*?left.*?<\s*?strong\s*?>([^<]*?)<', re.I)
-
- def getHoster(self):
- hosters = {
- 'depositfiles': ['depositfiles.com', 'dfiles.eu'],
- 'uploaded': ['uploaded.to', 'uploaded.net', 'ul.to'],
- 'rapidggator': ['rapidgator.net'], # they have a typo it's called rapidgator
- 'freakshare': ['freakshare.net', 'freakshare.com'],
- 'filefactory': ['filefactory.com'],
- 'bitshare': ['bitshare.com'],
- 'share-online': ['share-online.biz', 'egoshare.com'],
- 'youtube': ['youtube.com'],
- 'turbobit': ['turbobit.net', 'unextfiles.com'],
- 'firedrive': ['firedrive.com', 'putlocker.com'],
- 'filepost': ['filepost.com', 'fp.io'],
- 'netload': ['netload.in'],
- 'uploadhero': ['uploadhero.com'],
- 'ryushare': ['ryushare.com'],
- }
-
- #check if the list is still valid
- self.check_for_new_or_removed_hosters(hosters)
-
- #build list
- hoster_list = []
-
- for item in hosters.itervalues():
- hoster_list.extend(item)
-
- return hoster_list
-
- def check_for_new_or_removed_hosters(self, hosters):
- #get the old hosters
- old_hosters = hosters.keys()
-
- #load the current hosters from vipleech4u.com
- page = getURL('http://vipleech4u.com/hosts.php')
- current_hosters = self.HOSTER_PATTERN.findall(page)
- current_hosters = [x.lower() for x in current_hosters]
-
- #let's look for new hosters
- new_hosters = []
-
- for hoster in current_hosters:
- if not hoster in old_hosters:
- new_hosters.append(hoster)
-
- #let's look for removed hosters
- removed_hosters = []
-
- for hoster in old_hosters:
- if not hoster in current_hosters:
- removed_hosters.append(hoster)
-
- if new_hosters:
- self.logDebug('The following new hosters were found on vipleech4u.com: %s' % str(new_hosters))
-
- if removed_hosters:
- self.logDebug('The following hosters were removed from vipleech4u.com: %s' % str(removed_hosters))
-
- if not (new_hosters and removed_hosters):
- self.logDebug('The hoster list is still valid.')
diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py
index 7c005fcbb..01570b966 100644
--- a/module/plugins/hooks/WindowsPhoneToastNotify.py
+++ b/module/plugins/hooks/WindowsPhoneToastNotify.py
@@ -1,38 +1,27 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN, Godofdream, zoidberg
-"""
-import time
import httplib
+import time
+
from module.plugins.Hook import Hook
class WindowsPhoneToastNotify(Hook):
__name__ = "WindowsPhoneToastNotify"
+ __type__ = "hook"
__version__ = "0.02"
- __description__ = """Send push notifications to Windows Phone"""
- __author_name__ = "Andy Voigt"
- __author_mail__ = "phone-support@hotmail.de"
+
__config__ = [("activated", "bool", "Activated", False),
("force", "bool", "Force even if client is connected", False),
("pushId", "str", "pushId", ""),
("pushUrl", "str", "pushUrl", ""),
("pushTimeout", "int", "Timeout between notifications in seconds", 0)]
+ __description__ = """Send push notifications to Windows Phone"""
+ __author_name__ = "Andy Voigt"
+ __author_mail__ = "phone-support@hotmail.de"
+
+
def setup(self):
self.info = {}
diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py
index 19ecc08b6..eb0376921 100644
--- a/module/plugins/hooks/XFileSharingPro.py
+++ b/module/plugins/hooks/XFileSharingPro.py
@@ -7,16 +7,19 @@ from module.plugins.Hook import Hook
class XFileSharingPro(Hook):
__name__ = "XFileSharingPro"
- __version__ = "0.11"
__type__ = "hook"
+ __version__ = "0.11"
+
__config__ = [("activated", "bool", "Activated", True),
("loadDefault", "bool", "Include default (built-in) hoster list", True),
("includeList", "str", "Include hosters (comma separated)", ""),
("excludeList", "str", "Exclude hosters (comma separated)", "")]
+
__description__ = """XFileSharingPro hook plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def coreReady(self):
self.loadPattern()
@@ -61,8 +64,8 @@ class XFileSharingPro(Hook):
#self.logDebug(regexp)
dict = self.core.pluginManager.hosterPlugins['XFileSharingPro']
- dict["pattern"] = regexp
- dict["re"] = re.compile(regexp)
+ dict['pattern'] = regexp
+ dict['re'] = re.compile(regexp)
self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList))
def getConfigSet(self, option):
@@ -71,5 +74,5 @@ class XFileSharingPro(Hook):
def unload(self):
dict = self.core.pluginManager.hosterPlugins['XFileSharingPro']
- dict["pattern"] = r"^unmatchable$"
- dict["re"] = re.compile(r"^unmatchable$")
+ dict['pattern'] = r'^unmatchable$'
+ dict['re'] = re.compile(r'^unmatchable$')
diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py
index 5ecf4e153..c4a94a8bc 100644
--- a/module/plugins/hooks/XMPPInterface.py
+++ b/module/plugins/hooks/XMPPInterface.py
@@ -1,36 +1,19 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
- @interface-version: 0.2
-"""
-
from pyxmpp import streamtls
from pyxmpp.all import JID, Message
-from pyxmpp.jabber.client import JabberClient
from pyxmpp.interface import implements
from pyxmpp.interfaces import *
+from pyxmpp.jabber.client import JabberClient
from module.plugins.hooks.IRCInterface import IRCInterface
class XMPPInterface(IRCInterface, JabberClient):
__name__ = "XMPPInterface"
+ __type__ = "hook"
__version__ = "0.11"
- __description__ = """Connect to jabber and let owner perform different tasks"""
+
__config__ = [("activated", "bool", "Activated", False),
("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"),
("pw", "str", "Password", ""),
@@ -39,9 +22,12 @@ class XMPPInterface(IRCInterface, JabberClient):
("info_file", "bool", "Inform about every file finished", False),
("info_pack", "bool", "Inform about every package finished", True),
("captcha", "bool", "Send captcha requests", True)]
+
+ __description__ = """Connect to jabber and let owner perform different tasks"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
implements(IMessageHandlersProvider)
def __init__(self, core, manager):
@@ -120,16 +106,14 @@ class XMPPInterface(IRCInterface, JabberClient):
The handlers returned will be called when matching message is received
in a client session."""
- return [
- ("normal", self.message),
- ]
+ return [("normal", self.message)]
def message(self, stanza):
"""Message handler for the component."""
subject = stanza.get_subject()
body = stanza.get_body()
t = stanza.get_type()
- self.logDebug(u'pyLoad XMPP: Message from %s received.' % (unicode(stanza.get_from(), )))
+ self.logDebug(u'pyLoad XMPP: Message from %s received.' % (unicode(stanza.get_from(),)))
self.logDebug(u'pyLoad XMPP: Body: %s Subject: %s Type: %s' % (body, subject, t))
if t == "headline":
@@ -230,9 +214,7 @@ class VersionHandler(object):
def get_iq_get_handlers(self):
"""Return list of tuples (element_name, namespace, handler) describing
handlers of <iq type='get'/> stanzas"""
- return [
- ("query", "jabber:iq:version", self.get_version),
- ]
+ return [("query", "jabber:iq:version", self.get_version)]
def get_iq_set_handlers(self):
"""Return empty list, as this class provides no <iq type='set'/> stanza handler."""
diff --git a/module/plugins/hooks/ZeveraCom.py b/module/plugins/hooks/ZeveraCom.py
index 4dee83ccb..0d5e23118 100644
--- a/module/plugins/hooks/ZeveraCom.py
+++ b/module/plugins/hooks/ZeveraCom.py
@@ -6,15 +6,18 @@ from module.plugins.internal.MultiHoster import MultiHoster
class ZeveraCom(MultiHoster):
__name__ = "ZeveraCom"
- __version__ = "0.02"
__type__ = "hook"
+ __version__ = "0.02"
+
__config__ = [("activated", "bool", "Activated", False),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", "")]
+
__description__ = """Real-Debrid.com hook plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def getHoster(self):
page = getURL("http://www.zevera.com/jDownloader.ashx?cmd=gethosters")
return [x.strip() for x in page.replace("\"", "").split(",")]
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py
index 11ee8b7d3..7201f1929 100644
--- a/module/plugins/hoster/AlldebridCom.py
+++ b/module/plugins/hoster/AlldebridCom.py
@@ -1,23 +1,27 @@
# -*- coding: utf-8 -*-
import re
-from urllib import unquote
+
from random import randrange
-from module.plugins.Hoster import Hoster
+from urllib import unquote
+
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
from module.utils import parseFileSize
class AlldebridCom(Hoster):
__name__ = "AlldebridCom"
- __version__ = "0.34"
__type__ = "hoster"
+ __version__ = "0.34"
__pattern__ = r'https?://(?:[^/]*\.)?alldebrid\..*'
+
__description__ = """Alldebrid.com hoster plugin"""
__author_name__ = "Andy Voigt"
__author_mail__ = "spamsales@online.de"
+
def getFilename(self, url):
try:
name = unquote(url.rsplit("/", 1)[1])
@@ -48,17 +52,17 @@ class AlldebridCom(Hoster):
self.logDebug("Json data: %s" % str(data))
- if data["error"]:
- if data["error"] == "This link isn't available on the hoster website.":
+ if data['error']:
+ if data['error'] == "This link isn't available on the hoster website.":
self.offline()
else:
- self.logWarning(data["error"])
+ self.logWarning(data['error'])
self.tempOffline()
else:
if pyfile.name and not pyfile.name.endswith('.tmp'):
- pyfile.name = data["filename"]
- pyfile.size = parseFileSize(data["filesize"])
- new_url = data["link"]
+ pyfile.name = data['filename']
+ pyfile.size = parseFileSize(data['filesize'])
+ new_url = data['link']
if self.getConfig("https"):
new_url = new_url.replace("http://", "https://")
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py
index 970ac8081..54d789054 100644
--- a/module/plugins/hoster/BasePlugin.py
+++ b/module/plugins/hoster/BasePlugin.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-from urlparse import urlparse
from re import match, search
from urllib import unquote
+from urlparse import urlparse
from module.network.HTTPRequest import BadHeader
from module.plugins.Hoster import Hoster
@@ -12,12 +12,15 @@ from module.utils import html_unescape, remove_chars
class BasePlugin(Hoster):
__name__ = "BasePlugin"
__type__ = "hoster"
+ __version__ = "0.20"
+
__pattern__ = r'^unmatchable$'
- __version__ = "0.19"
+
__description__ = """Base Plugin when any other didnt fit"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
@@ -55,7 +58,7 @@ class BasePlugin(Hoster):
if server in servers:
self.logDebug("Logging on to %s" % server)
- self.req.addAuth(account.accounts[server]["password"])
+ self.req.addAuth(account.accounts[server]['password'])
else:
for pwd in pyfile.package().password.splitlines():
if ":" in pwd:
@@ -85,7 +88,7 @@ class BasePlugin(Hoster):
self.logDebug("Location: " + header['location'])
base = match(r'https?://[^/]+', url).group(0)
if header['location'].startswith("http"):
- url = unquote(header['location'])
+ url = header['location']
elif header['location'].startswith("/"):
url = base + unquote(header['location'])
else:
diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py
index b080eb386..dc7e8cbf0 100644
--- a/module/plugins/hoster/BayfilesCom.py
+++ b/module/plugins/hoster/BayfilesCom.py
@@ -1,59 +1,46 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from time import time
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.common.json_layer import json_loads
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class BayfilesCom(SimpleHoster):
__name__ = "BayfilesCom"
__type__ = "hoster"
+ __version__ = "0.07"
+
__pattern__ = r'https?://(?:www\.)?bayfiles\.(com|net)/file/(?P<ID>[a-zA-Z0-9]+/[a-zA-Z0-9]+/[^/]+)'
- __version__ = "0.06"
+
__description__ = """Bayfiles.com hoster plugin"""
__author_name__ = ("zoidberg", "Walter Purcaro")
__author_mail__ = ("zoidberg@mujmail.cz", "vuolter@gmail.com")
FILE_INFO_PATTERN = r'<p title="(?P<N>[^"]+)">[^<]*<strong>(?P<S>[0-9., ]+)(?P<U>[kKMG])i?B</strong></p>'
- FILE_OFFLINE_PATTERN = r'(<p>The requested file could not be found.</p>|<title>404 Not Found</title>)'
+ OFFLINE_PATTERN = r'(<p>The requested file could not be found.</p>|<title>404 Not Found</title>)'
WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<'
VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);'
- LINK_PATTERN = r"javascript:window.location.href = '([^']+)';"
+ FREE_LINK_PATTERN = r"javascript:window.location.href = '([^']+)';"
PREMIUM_LINK_PATTERN = r'(?:<a class="highlighted-btn" href="|(?=http://s\d+\.baycdn\.com/dl/))(.*?)"'
+
def handleFree(self):
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- self.wait(int(found.group(1)) * 60)
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ self.wait(int(m.group(1)) * 60)
self.retry()
# Get download token
- found = re.search(self.VARS_PATTERN, self.html)
- if not found:
+ m = re.search(self.VARS_PATTERN, self.html)
+ if m is None:
self.parseError('VARS')
- vfid, delay = found.groups()
+ vfid, delay = m.groups()
- response = json_loads(self.load('https://bayfiles.com/ajax_download', get={
+ response = json_loads(self.load('http://bayfiles.com/ajax_download', get={
"_": time() * 1000,
"action": "startTimer",
"vfid": vfid}, decode=True))
@@ -63,22 +50,22 @@ class BayfilesCom(SimpleHoster):
self.wait(int(delay))
- self.html = self.load('https://bayfiles.com/ajax_download', get={
+ self.html = self.load('http://bayfiles.com/ajax_download', get={
"token": response['token'],
"action": "getLink",
"vfid": vfid})
# Get final link and download
- found = re.search(self.LINK_PATTERN, self.html)
- if not found:
+ m = re.search(self.FREE_LINK_PATTERN, self.html)
+ if m is None:
self.parseError("Free link")
- self.startDownload(found.group(1))
+ self.startDownload(m.group(1))
def handlePremium(self):
- found = re.search(self.PREMIUM_LINK_PATTERN, self.html)
- if not found:
+ m = re.search(self.PREMIUM_LINK_PATTERN, self.html)
+ if m is None:
self.parseError("Premium link")
- self.startDownload(found.group(1))
+ self.startDownload(m.group(1))
def startDownload(self, url):
self.logDebug("%s URL: %s" % ("Premium" if self.premium else "Free", url))
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index 55f3f33b9..7156db473 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -1,48 +1,35 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class BezvadataCz(SimpleHoster):
__name__ = "BezvadataCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?bezvadata.cz/stahnout/.*'
__version__ = "0.24"
+
+ __pattern__ = r'http://(?:www\.)?bezvadata.cz/stahnout/.*'
+
__description__ = """BezvaData.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>'
FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>'
- FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>'
+ OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>'
+
def setup(self):
self.multiDL = self.resumeDownload = True
def handleFree(self):
#download button
- found = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html)
- if not found:
+ m = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html)
+ if m is None:
self.parseError("page1 URL")
- url = "http://bezvadata.cz%s" % found.group(1)
+ url = "http://bezvadata.cz%s" % m.group(1)
#captcha form
self.html = self.load(url)
@@ -52,14 +39,14 @@ class BezvadataCz(SimpleHoster):
if not inputs:
self.parseError("FreeForm")
- found = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html)
- if not found:
+ m = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html)
+ if m is None:
self.parseError("captcha img")
#captcha image is contained in html page as base64encoded data but decryptCaptcha() expects image url
self.load, proper_load = self.loadcaptcha, self.load
try:
- inputs['captcha'] = self.decryptCaptcha(found.group(1), imgtype='png')
+ inputs['captcha'] = self.decryptCaptcha(m.group(1), imgtype='png')
finally:
self.load = proper_load
@@ -74,15 +61,15 @@ class BezvadataCz(SimpleHoster):
#download url
self.html = self.load("http://bezvadata.cz%s" % action, post=inputs)
self.checkErrors()
- found = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html)
- if not found:
+ m = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html)
+ if m is None:
self.parseError("page2 URL")
- url = "http://bezvadata.cz%s" % found.group(1)
+ url = "http://bezvadata.cz%s" % m.group(1)
self.logDebug("DL URL %s" % url)
#countdown
- found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html)
- wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120
+ m = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html)
+ wait_time = (int(m.group(1)) * 60 + int(m.group(2)) + 1) if m else 120
self.wait(wait_time, False)
self.download(url)
diff --git a/module/plugins/hoster/BillionuploadsCom.py b/module/plugins/hoster/BillionuploadsCom.py
index ab2634c91..c55b9073c 100644
--- a/module/plugins/hoster/BillionuploadsCom.py
+++ b/module/plugins/hoster/BillionuploadsCom.py
@@ -6,8 +6,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class BillionuploadsCom(XFileSharingPro):
__name__ = "BillionuploadsCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?billionuploads.com/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?billionuploads.com/\w{12}'
+
__description__ = """Billionuploads.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py
index d4b0668c0..3c84ce5da 100644
--- a/module/plugins/hoster/BitshareCom.py
+++ b/module/plugins/hoster/BitshareCom.py
@@ -4,28 +4,31 @@ from __future__ import with_statement
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class BitshareCom(SimpleHoster):
__name__ = "BitshareCom"
__type__ = "hoster"
+ __version__ = "0.50"
+
__pattern__ = r'http://(?:www\.)?bitshare\.com/(files/(?P<id1>[a-zA-Z0-9]+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>[a-zA-Z0-9]+))'
- __version__ = "0.49"
+
__description__ = """Bitshare.com hoster plugin"""
__author_name__ = ("Paul King", "fragonib")
__author_mail__ = ("", "fragonib[AT]yahoo[DOT]es")
- HOSTER_DOMAIN = "bitshare.com"
- FILE_OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)'
FILE_INFO_PATTERN = r'Downloading (?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)</h1>'
+ OFFLINE_PATTERN = r'(>We are sorry, but the requested file was not found in our database|>Error - File not available<|The file was deleted either by the uploader, inactivity or due to copyright claim)'
+
FILE_AJAXID_PATTERN = r'var ajaxdl = "(.*?)";'
- CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) "
- TRAFFIC_USED_UP = r"Your Traffic is used up for today. Upgrade to premium to continue!"
+ CAPTCHA_KEY_PATTERN = r'http://api\.recaptcha\.net/challenge\?k=(.*?) '
+ TRAFFIC_USED_UP = r'Your Traffic is used up for today. Upgrade to premium to continue!'
+
def setup(self):
- self.req.cj.setCookie(self.HOSTER_DOMAIN, "language_selection", "EN")
+ self.req.cj.setCookie(".bitshare.com", "language_selection", "EN")
self.multiDL = self.premium
self.chunkLimit = 1
@@ -44,13 +47,12 @@ class BitshareCom(SimpleHoster):
self.html = self.load(pyfile.url, ref=False, decode=True)
# Check offline
- if re.search(self.FILE_OFFLINE_PATTERN, self.html):
+ if re.search(self.OFFLINE_PATTERN, self.html):
self.offline()
# Check Traffic used up
if re.search(self.TRAFFIC_USED_UP, self.html):
- self.logInfo("Your Traffic is used up for today. Wait 1800 seconds or reconnect!")
- self.logDebug("Waiting %d seconds." % 1800)
+ self.logInfo("Your Traffic is used up for today")
self.wait(30 * 60, True)
self.retry()
@@ -70,6 +72,12 @@ class BitshareCom(SimpleHoster):
self.logDebug("Downloading file with url [%s]" % url)
self.download(url)
+ check = self.checkDownload({"404": ">404 Not Found<", "Error": ">Error occured<"})
+ if check == "404":
+ self.retry(3, 60, 'Error 404')
+ elif check == "error":
+ self.retry(5, 5 * 60, "Bitshare host : Error occured")
+
def getDownloadUrl(self):
# Return location if direct download is active
if self.premium:
diff --git a/module/plugins/hoster/BoltsharingCom.py b/module/plugins/hoster/BoltsharingCom.py
index a1672dc22..d038c50ca 100644
--- a/module/plugins/hoster/BoltsharingCom.py
+++ b/module/plugins/hoster/BoltsharingCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class BoltsharingCom(DeadHoster):
__name__ = "BoltsharingCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?boltsharing.com/\w{12}'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?boltsharing.com/\w{12}'
+
__description__ = """Boltsharing.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py
index efaf8e5f7..4bbdfce89 100644
--- a/module/plugins/hoster/CatShareNet.py
+++ b/module/plugins/hoster/CatShareNet.py
@@ -1,27 +1,33 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class CatShareNet(SimpleHoster):
__name__ = "CatShareNet"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?catshare.net/\w{16}.*'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?catshare.net/\w{16}.*'
+
__description__ = """CatShare.net hoster plugin"""
__author_name__ = "z00nx"
__author_mail__ = "z00nx0@gmail.com"
FILE_INFO_PATTERN = r'<h3 class="pull-left"[^>]+>(?P<N>.*)</h3>\s+<h3 class="pull-right"[^>]+>(?P<S>.*)</h3>'
- FILE_OFFLINE_PATTERN = r'Podany plik zosta'
- SECONDS_PATTERN = 'var\s+count\s+=\s+(\d+);'
+ OFFLINE_PATTERN = r'Podany plik zosta'
+
+ SECONDS_PATTERN = r'var\s+count\s+=\s+(\d+);'
+
RECAPTCHA_KEY = "6Lfln9kSAAAAANZ9JtHSOgxUPB9qfDFeLUI_QMEy"
+
def handleFree(self):
- found = re.search(self.SECONDS_PATTERN, self.html)
- seconds = int(found.group(1))
+ m = re.search(self.SECONDS_PATTERN, self.html)
+ seconds = int(m.group(1))
self.logDebug("Seconds found", seconds)
self.wait(seconds + 1)
recaptcha = ReCaptcha(self)
diff --git a/module/plugins/hoster/CloudzerNet.py b/module/plugins/hoster/CloudzerNet.py
index 6e47ce53f..72332c56f 100644
--- a/module/plugins/hoster/CloudzerNet.py
+++ b/module/plugins/hoster/CloudzerNet.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class CloudzerNet(DeadHoster):
__name__ = "CloudzerNet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?(cloudzer\.net/file/|clz\.to/(file/)?)\w+'
__version__ = "0.05"
+
+ __pattern__ = r'https?://(?:www\.)?(cloudzer\.net/file/|clz\.to/(file/)?)\w+'
+
__description__ = """Cloudzer.net hoster plugin"""
__author_name__ = ("gs", "z00nx", "stickell")
__author_mail__ = ("I-_-I-_-I@web.de", "z00nx0@gmail.com", "l.stickell@yahoo.it")
diff --git a/module/plugins/hoster/CramitIn.py b/module/plugins/hoster/CramitIn.py
index e882f5cea..6a872ab34 100644
--- a/module/plugins/hoster/CramitIn.py
+++ b/module/plugins/hoster/CramitIn.py
@@ -6,8 +6,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class CramitIn(XFileSharingPro):
__name__ = "CramitIn"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?cramit.in/\w{12}'
__version__ = "0.04"
+
+ __pattern__ = r'http://(?:www\.)?cramit.in/\w{12}'
+
__description__ = """Cramit.in hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -15,7 +17,8 @@ class CramitIn(XFileSharingPro):
HOSTER_NAME = "cramit.in"
FILE_INFO_PATTERN = r'<span class=t2>\s*(?P<N>.*?)</span>.*?<small>\s*\((?P<S>.*?)\)'
- DIRECT_LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"'
+ LINK_PATTERN = r'href="(http://cramit.in/file_download/.*?)"'
+
def setup(self):
self.resumeDownload = self.multiDL = self.premium
diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py
index 3cd2be59d..80d9b3d61 100644
--- a/module/plugins/hoster/CrockoCom.py
+++ b/module/plugins/hoster/CrockoCom.py
@@ -2,23 +2,25 @@
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class CrockoCom(SimpleHoster):
__name__ = "CrockoCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(crocko|easy-share).com/\w+'
__version__ = "0.16"
+
+ __pattern__ = r'http://(?:www\.)?(crocko|easy-share).com/\w+'
+
__description__ = """Crocko hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<span class="fz24">Download:\s*<strong>(?P<N>.*)'
FILE_SIZE_PATTERN = r'<span class="tip1"><span class="inner">(?P<S>[^<]+)</span></span>'
- FILE_OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>|File not found"
- DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';"
+ OFFLINE_PATTERN = r"<h1>Sorry,<br />the page you're looking for <br />isn't here.</h1>|File not found"
+
CAPTCHA_URL_PATTERN = re.compile(r"u='(/file_contents/captcha/\w+)';\s*w='(\d+)';")
CAPTCHA_KEY_PATTERN = re.compile(r'Recaptcha.create\("([^"]+)"')
@@ -27,28 +29,29 @@ class CrockoCom(SimpleHoster):
FILE_NAME_REPLACEMENTS = [(r'<[^>]*>', '')]
+
def handleFree(self):
if "You need Premium membership to download this file." in self.html:
self.fail("You need Premium membership to download this file.")
for _ in xrange(5):
- found = re.search(self.CAPTCHA_URL_PATTERN, self.html)
- if found:
- url, wait_time = 'http://crocko.com' + found.group(1), found.group(2)
+ m = re.search(self.CAPTCHA_URL_PATTERN, self.html)
+ if m:
+ url, wait_time = 'http://crocko.com' + m.group(1), m.group(2)
self.wait(wait_time)
self.html = self.load(url)
else:
break
- found = re.search(self.CAPTCHA_KEY_PATTERN, self.html)
- if not found:
+ m = re.search(self.CAPTCHA_KEY_PATTERN, self.html)
+ if m is None:
self.parseError('Captcha KEY')
- captcha_key = found.group(1)
+ captcha_key = m.group(1)
- found = re.search(self.FORM_PATTERN, self.html, re.DOTALL)
- if not found:
+ m = re.search(self.FORM_PATTERN, self.html, re.DOTALL)
+ if m is None:
self.parseError('ACTION')
- action, form = found.groups()
+ action, form = m.groups()
inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
recaptcha = ReCaptcha(self)
diff --git a/module/plugins/hoster/CyberlockerCh.py b/module/plugins/hoster/CyberlockerCh.py
index a08bf8518..bfab72b7c 100644
--- a/module/plugins/hoster/CyberlockerCh.py
+++ b/module/plugins/hoster/CyberlockerCh.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class CyberlockerCh(DeadHoster):
__name__ = "CyberlockerCh"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?cyberlocker\.ch/\w+'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?cyberlocker\.ch/\w+'
+
__description__ = """Cyberlocker.ch hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py
index a462deaff..4f581651b 100644
--- a/module/plugins/hoster/CzshareCom.py
+++ b/module/plugins/hoster/CzshareCom.py
@@ -1,45 +1,32 @@
# -*- coding: utf-8 -*-
-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
-# Test links (random.bin):
+#
+# Test links:
# http://czshare.com/5278880/random.bin
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.utils import parseFileSize
class CzshareCom(SimpleHoster):
__name__ = "CzshareCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download.php\?).*'
__version__ = "0.94"
+
+ __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download.php\?).*'
+
__description__ = """CZshare.com hoster plugin, now Sdilej.cz"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<div class="tab" id="parameters">\s*<p>\s*Cel. n.zev: <a href=[^>]*>(?P<N>[^<]+)</a>'
FILE_SIZE_PATTERN = r'<div class="tab" id="category">(?:\s*<p>[^\n]*</p>)*\s*Velikost:\s*(?P<S>[0-9., ]+)(?P<U>[kKMG])i?B\s*</div>'
- FILE_OFFLINE_PATTERN = r'<div class="header clearfix">\s*<h2 class="red">'
+ OFFLINE_PATTERN = r'<div class="header clearfix">\s*<h2 class="red">'
FILE_SIZE_REPLACEMENTS = [(' ', '')]
FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://sdilej.cz/\1/x/')]
+
SH_CHECK_TRAFFIC = True
FREE_URL_PATTERN = r'<a href="([^"]+)" class="page-download">[^>]*alt="([^"]+)" /></a>'
@@ -49,19 +36,20 @@ class CzshareCom(SimpleHoster):
MULTIDL_PATTERN = r"<p><font color='red'>Z[^<]*PROFI.</font></p>"
USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([0-9., ]+)([kKMG]i?B)</strong>\s*</div><!-- .credit -->'
+
def checkTrafficLeft(self):
# check if user logged in
- found = re.search(self.USER_CREDIT_PATTERN, self.html)
- if not found:
+ m = re.search(self.USER_CREDIT_PATTERN, self.html)
+ if m is None:
self.account.relogin(self.user)
self.html = self.load(self.pyfile.url, cookies=True, decode=True)
- found = re.search(self.USER_CREDIT_PATTERN, self.html)
- if not found:
+ m = re.search(self.USER_CREDIT_PATTERN, self.html)
+ if m is None:
return False
# check user credit
try:
- credit = parseFileSize(found.group(1).replace(' ', ''), found.group(2))
+ credit = parseFileSize(m.group(1).replace(' ', ''), m.group(2))
self.logInfo("Premium download for %i KiB of Credit" % (self.pyfile.size / 1024))
self.logInfo("User %s has %i KiB left" % (self.user, credit / 1024))
if credit < self.pyfile.size:
@@ -88,10 +76,10 @@ class CzshareCom(SimpleHoster):
def handleFree(self):
# get free url
- found = re.search(self.FREE_URL_PATTERN, self.html)
- if found is None:
- raise PluginParseError('Free URL')
- parsed_url = "http://sdilej.cz" + found.group(1)
+ m = re.search(self.FREE_URL_PATTERN, self.html)
+ if m is None:
+ self.parseError('Free URL')
+ parsed_url = "http://sdilej.cz" + m.group(1)
self.logDebug("PARSED_URL:" + parsed_url)
# get download ticket and parse html
@@ -105,9 +93,9 @@ class CzshareCom(SimpleHoster):
self.pyfile.size = int(inputs['size'])
except Exception, e:
self.logError(e)
- raise PluginParseError('Form')
+ self.parseError('Form')
- # get and decrypt captcha
+ # get and decrypt captcha
captcha_url = 'http://sdilej.cz/captcha.php'
for _ in xrange(5):
inputs['captchastring2'] = self.decryptCaptcha(captcha_url)
@@ -122,16 +110,16 @@ class CzshareCom(SimpleHoster):
else:
self.fail("No valid captcha code entered")
- found = re.search("countdown_number = (\d+);", self.html)
- self.setWait(int(found.group(1)) if found else 50)
+ m = re.search("countdown_number = (\d+);", self.html)
+ self.setWait(int(m.group(1)) if m else 50)
# download the file, destination is determined by pyLoad
self.logDebug("WAIT URL", self.req.lastEffectiveURL)
- found = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL)
- if not found:
- raise PluginParseError('Download URL')
+ m = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL)
+ if m is None:
+ self.parseError('Download URL')
- url = "http://%s/download.php?%s" % (found.group(1), found.group(2))
+ url = "http://%s/download.php?%s" % (m.group(1), m.group(2))
self.wait()
self.download(url)
diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py
index 17e1ecf92..79b7acb45 100644
--- a/module/plugins/hoster/DailymotionCom.py
+++ b/module/plugins/hoster/DailymotionCom.py
@@ -1,28 +1,11 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-############################################################################
-
import re
+from module.PyFile import statusMap
from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
from module.plugins.Hoster import Hoster
-from module.PyFile import statusMap
def getInfo(urls):
@@ -36,14 +19,14 @@ def getInfo(urls):
info = json_loads(page)
if "title" in info:
- name = info["title"] + ".mp4"
+ name = info['title'] + ".mp4"
else:
name = url
- if "error" in info or info["access_error"]:
+ if "error" in info or info['access_error']:
status = "offline"
else:
- status = info["status"]
+ status = info['status']
if status in ("ready", "published"):
status = "online"
elif status in ("waiting", "processing"):
@@ -58,13 +41,16 @@ def getInfo(urls):
class DailymotionCom(Hoster):
__name__ = "DailymotionCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?dailymotion\.com/.*?video/(?P<ID>[\w^_]+)'
__version__ = "0.2"
- __config__ = [("quality", "Lowest;LD 144p;LD 240p;SD 384p;HQ 480p;HD 720p;HD 1080p;Highest", "Quality", "HD 720p")]
+
+ __pattern__ = r'https?://(?:www\.)?dailymotion\.com/.*?video/(?P<ID>[\w^_]+)'
+ __config__ = [("quality", "Lowest;LD 144p;LD 240p;SD 384p;HQ 480p;HD 720p;HD 1080p;Highest", "Quality", "Highest")]
+
__description__ = """Dailymotion.com hoster plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
+
def setup(self):
self.resumeDownload = self.multiDL = True
diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py
index 0c872b419..3dc01eef3 100644
--- a/module/plugins/hoster/DataHu.py
+++ b/module/plugins/hoster/DataHu.py
@@ -1,20 +1,6 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test links (random.bin):
+#
+# Test links:
# http://data.hu/get/6381232/random.bin
import re
@@ -25,21 +11,24 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DataHu(SimpleHoster):
__name__ = "DataHu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?data.hu/get/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?data.hu/get/\w+'
+
__description__ = """Data.hu hoster plugin"""
__author_name__ = ("crash", "stickell")
__author_mail__ = "l.stickell@yahoo.it"
FILE_INFO_PATTERN = ur'<title>(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se</title>'
- FILE_OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik'
- DIRECT_LINK_PATTERN = r'<div class="download_box_button"><a href="([^"]+)">'
+ OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik'
+ LINK_PATTERN = r'<div class="download_box_button"><a href="([^"]+)">'
+
def handleFree(self):
self.resumeDownload = True
self.html = self.load(self.pyfile.url, decode=True)
- m = re.search(self.DIRECT_LINK_PATTERN, self.html)
+ m = re.search(self.LINK_PATTERN, self.html)
if m:
url = m.group(1)
self.logDebug('Direct link: ' + url)
diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py
index 291dcaf55..56b2c2398 100644
--- a/module/plugins/hoster/DataportCz.py
+++ b/module/plugins/hoster/DataportCz.py
@@ -1,42 +1,29 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DataportCz(SimpleHoster):
__name__ = "DataportCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?dataport.cz/file/(.*)'
__version__ = "0.37"
+
+ __pattern__ = r'http://(?:www\.)?dataport.cz/file/(.*)'
+
__description__ = """Dataport.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<span itemprop="name">(?P<N>[^<]+)</span>'
FILE_SIZE_PATTERN = r'<td class="fil">Velikost</td>\s*<td>(?P<S>[^<]+)</td>'
- FILE_OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>'
+ OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>'
+
FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')]
CAPTCHA_URL_PATTERN = r'<section id="captcha_bg">\s*<img src="(.*?)"'
FREE_SLOTS_PATTERN = ur'Počet volnÜch slotů: <span class="darkblue">(\d+)</span><br />'
+
def handleFree(self):
captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"}
@@ -44,19 +31,19 @@ class DataportCz(SimpleHoster):
action, inputs = self.parseHtmlForm('free_download_form')
self.logDebug(action, inputs)
if not action or not inputs:
- raise PluginParseError('free_download_form')
+ self.parseError('free_download_form')
- if "captchaId" in inputs and inputs["captchaId"] in captchas:
- inputs['captchaCode'] = captchas[inputs["captchaId"]]
+ if "captchaId" in inputs and inputs['captchaId'] in captchas:
+ inputs['captchaCode'] = captchas[inputs['captchaId']]
else:
- raise PluginParseError('captcha')
+ self.parseError('captcha')
self.html = self.download("http://www.dataport.cz%s" % action, post=inputs)
check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");',
"slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'})
if check == "captcha":
- raise PluginParseError('invalid captcha')
+ self.parseError('invalid captcha')
elif check == "slot":
self.logDebug("No free slots - wait 60s and retry")
self.wait(60, False)
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 223138592..ff8c430ee 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -1,45 +1,32 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DateiTo(SimpleHoster):
__name__ = "DateiTo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P<ID>\w+)\.html'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?datei\.to/datei/(?P<ID>\w+)\.html'
+
__description__ = """Datei.to hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</'
FILE_SIZE_PATTERN = r'Dateigr&ouml;&szlig;e:</td>\s*<td colspan="2">(?P<S>.*?)</'
- FILE_OFFLINE_PATTERN = r'>Datei wurde nicht gefunden<|>Bitte wÀhle deine Datei aus... <'
+ OFFLINE_PATTERN = r'>Datei wurde nicht gefunden<|>Bitte wÀhle deine Datei aus... <'
PARALELL_PATTERN = r'>Du lÀdst bereits eine Datei herunter<'
WAIT_PATTERN = r'countdown\({seconds: (\d+)'
DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",'
RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"'
+
def handleFree(self):
url = 'http://datei.to/ajax/download.php'
data = {'P': 'I', 'ID': self.file_info['ID']}
@@ -58,15 +45,15 @@ class DateiTo(SimpleHoster):
elif data['P'] == 'IV':
break
- found = re.search(self.DATA_PATTERN, self.html)
- if not found:
+ m = re.search(self.DATA_PATTERN, self.html)
+ if m is None:
self.parseError('data')
- url = 'http://datei.to/' + found.group(1)
- data = dict(x.split('=') for x in found.group(2).split('&'))
+ url = 'http://datei.to/' + m.group(1)
+ data = dict(x.split('=') for x in m.group(2).split('&'))
if url.endswith('recaptcha.php'):
- found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
- recaptcha_key = found.group(1) if found else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao"
+ m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
+ recaptcha_key = m.group(1) if m else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao"
data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key)
@@ -78,16 +65,16 @@ class DateiTo(SimpleHoster):
self.download(download_url)
def checkErrors(self):
- found = re.search(self.PARALELL_PATTERN, self.html)
- if found:
- found = re.search(self.WAIT_PATTERN, self.html)
- wait_time = int(found.group(1)) if found else 30
+ m = re.search(self.PARALELL_PATTERN, self.html)
+ if m:
+ m = re.search(self.WAIT_PATTERN, self.html)
+ wait_time = int(m.group(1)) if m else 30
self.wait(wait_time + 1, False)
self.retry()
def doWait(self):
- found = re.search(self.WAIT_PATTERN, self.html)
- wait_time = int(found.group(1)) if found else 30
+ m = re.search(self.WAIT_PATTERN, self.html)
+ wait_time = int(m.group(1)) if m else 30
self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'})
self.wait(wait_time + 1, False)
diff --git a/module/plugins/hoster/DdlstorageCom.py b/module/plugins/hoster/DdlstorageCom.py
index eed53b1e1..4d77289d7 100644
--- a/module/plugins/hoster/DdlstorageCom.py
+++ b/module/plugins/hoster/DdlstorageCom.py
@@ -1,89 +1,18 @@
# -*- coding: utf-8 -*-
-import re
-from hashlib import md5
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro
-from module.network.RequestFactory import getURL
-from module.plugins.Plugin import chunks
-from module.common.json_layer import json_loads
-
-def getInfo(urls):
- # DDLStorage API Documentation:
- # http://www.ddlstorage.com/cgi-bin/api_req.cgi?req_type=doc
- ids = dict()
- for url in urls:
- m = re.search(DdlstorageCom.__pattern__, url)
- ids[m.group('ID')] = url
-
- for chunk in chunks(ids.keys(), 5):
- for _ in xrange(5):
- api = getURL('http://www.ddlstorage.com/cgi-bin/api_req.cgi',
- post={'req_type': 'file_info_free',
- 'client_id': 53472,
- 'file_code': ','.join(chunk),
- 'sign': md5('file_info_free%d%s%s' % (53472, ','.join(chunk),
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()})
- api = api.replace('<pre>', '').replace('</pre>', '')
- api = json_loads(api)
- if 'error' not in api:
- break
-
- result = list()
- for el in api:
- if el['status'] == 'online':
- result.append((el['file_name'], int(el['file_size']), 2, ids[el['file_code']]))
- else:
- result.append((ids[el['file_code']], 0, 1, ids[el['file_code']]))
- yield result
-
-
-class DdlstorageCom(XFileSharingPro):
+class DdlstorageCom(DeadHoster):
__name__ = "DdlstorageCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?ddlstorage.com/(?P<ID>\w{12})'
- __version__ = "1.01"
+ __version__ = "1.02"
+
+ __pattern__ = r'https?://(?:www\.)?ddlstorage\.com/\w+'
+
__description__ = """DDLStorage.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
- HOSTER_NAME = "ddlstorage.com"
-
- FILE_INFO_PATTERN = r'<p class="sub_title"[^>]*>(?P<N>.+) \((?P<S>[^)]+)\)</p>'
-
- def prepare(self):
- self.getAPIData()
- super(DdlstorageCom, self).prepare()
-
- def getAPIData(self):
- file_id = re.match(self.__pattern__, self.pyfile.url).group('ID')
- data = {'client_id': 53472,
- 'file_code': file_id}
- if self.user:
- passwd = self.account.getAccountData(self.user)["password"]
- data['req_type'] = 'file_info_reg'
- data['user_login'] = self.user
- data['user_password'] = md5(passwd).hexdigest()
- data['sign'] = md5('file_info_reg%d%s%s%s%s' % (data['client_id'], data['user_login'],
- data['user_password'], data['file_code'],
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()
- else:
- data['req_type'] = 'file_info_free'
- data['sign'] = md5('file_info_free%d%s%s' % (data['client_id'], data['file_code'],
- '25JcpU2dPOKg8E2OEoRqMSRu068r0Cv3')).hexdigest()
-
- self.api_data = self.load('http://www.ddlstorage.com/cgi-bin/api_req.cgi', post=data)
- self.api_data = self.api_data.replace('<pre>', '').replace('</pre>', '')
- self.logDebug('API Data: ' + self.api_data)
- self.api_data = json_loads(self.api_data)[0]
-
- if self.api_data['status'] == 'offline':
- self.offline()
- if 'file_name' in self.api_data:
- self.pyfile.name = self.api_data['file_name']
- if 'file_size' in self.api_data:
- self.pyfile.size = self.api_data['size'] = self.api_data['file_size']
- if 'file_md5_base64' in self.api_data:
- self.api_data['md5_ddlstorage'] = self.api_data['file_md5_base64']
+getInfo = create_getInfo(DdlstorageCom)
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py
index a8b4248b4..5880b2738 100644
--- a/module/plugins/hoster/DebridItaliaCom.py
+++ b/module/plugins/hoster/DebridItaliaCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
@@ -21,13 +7,16 @@ from module.plugins.Hoster import Hoster
class DebridItaliaCom(Hoster):
__name__ = "DebridItaliaCom"
- __version__ = "0.05"
__type__ = "hoster"
+ __version__ = "0.05"
+
__pattern__ = r'https?://(?:[^/]*\.)?debriditalia\.com'
+
__description__ = """Debriditalia.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py
index 11b4f4112..e2b2d46fd 100644
--- a/module/plugins/hoster/DepositfilesCom.py
+++ b/module/plugins/hoster/DepositfilesCom.py
@@ -1,34 +1,43 @@
# -*- coding: utf-8 -*-
import re
+
from urllib import unquote
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class DepositfilesCom(SimpleHoster):
__name__ = "DepositfilesCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/[\w]+'
- __version__ = "0.46"
+ __version__ = "0.48"
+
+ __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P<ID>\w+)'
+
__description__ = """Depositfiles.com hoster plugin"""
- __author_name__ = ("spoob", "zoidberg")
- __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz")
+ __author_name__ = ("spoob", "zoidberg", "Walter Purcaro")
+ __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "vuolter@gmail.com")
- FILE_SIZE_PATTERN = r': <b>(?P<S>[0-9.]+)&nbsp;(?P<U>[kKMG])i?B</b>'
FILE_NAME_PATTERN = r'<script type="text/javascript">eval\( unescape\(\'(?P<N>.*?)\''
- FILE_OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>'
- FILE_URL_REPLACEMENTS = [(r"\.com(/.*?)?/files", ".com/en/files"), (r"\.html$", "")]
+ FILE_SIZE_PATTERN = r': <b>(?P<S>[0-9.]+)&nbsp;(?P<U>[kKMG])i?B</b>'
+ OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>'
+
FILE_NAME_REPLACEMENTS = [(r'\%u([0-9A-Fa-f]{4})', lambda m: unichr(int(m.group(1), 16))),
(r'.*<b title="(?P<N>[^"]+).*', "\g<N>")]
+ FILE_URL_REPLACEMENTS = [(__pattern__, "https://dfiles.eu/files/\g<ID>")]
+
+ SH_COOKIES = [(".dfiles.eu", "lang_current", "en")]
RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'"
- DOWNLOAD_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"'
+
+ FREE_LINK_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"'
+ PREMIUM_LINK_PATTERN = r'class="repeat"><a href="(.+?)"'
+ PREMIUM_MIRROR_PATTERN = r'class="repeat_mirror"><a href="(.+?)"'
+
def handleFree(self):
self.html = self.load(self.pyfile.url, post={"gateway_result": "1"}, cookies=True)
- if re.search(self.FILE_OFFLINE_PATTERN, self.html):
- self.offline()
if re.search(r'File is checked, please try again in a minute.', self.html) is not None:
self.logInfo("DepositFiles.com: The file is being checked. Waiting 1 minute.")
@@ -52,23 +61,23 @@ class DepositfilesCom(SimpleHoster):
if wait:
self.setWait(int(wait.group(1)))
- found = re.search(r"var fid = '(\w+)';", self.html)
- if not found:
+ m = re.search(r"var fid = '(\w+)';", self.html)
+ if m is None:
self.retry(wait_time=5)
- params = {'fid': found.group(1)}
+ params = {'fid': m.group(1)}
self.logDebug("FID: %s" % params['fid'])
captcha_key = '6LdRTL8SAAAAAE9UOdWZ4d0Ky-aeA7XfSqyWDM2m'
- found = re.search(self.RECAPTCHA_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.RECAPTCHA_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
self.logDebug("CAPTCHA_KEY: %s" % captcha_key)
self.wait()
recaptcha = ReCaptcha(self)
for _ in xrange(5):
- self.html = self.load("http://depositfiles.com/get_file.php", get=params)
+ self.html = self.load("https://dfiles.eu/get_file.php", get=params)
if '<input type=button value="Continue" onclick="check_recaptcha' in self.html:
if not captcha_key:
@@ -79,11 +88,11 @@ class DepositfilesCom(SimpleHoster):
self.logDebug(params)
continue
- found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if found:
+ m = re.search(self.FREE_LINK_PATTERN, self.html)
+ if m:
if 'response' in params:
self.correctCaptcha()
- link = unquote(found.group(1))
+ link = unquote(m.group(1))
self.logDebug("LINK: %s" % link)
break
else:
@@ -97,15 +106,24 @@ class DepositfilesCom(SimpleHoster):
self.retry(wait_time=60)
def handlePremium(self):
+ self.html = self.load(self.pyfile.url, cookies=self.SH_COOKIES)
+
if '<span class="html_download_api-gold_traffic_limit">' in self.html:
self.logWarning("Download limit reached")
self.retry(25, 60 * 60, "Download limit reached")
elif 'onClick="show_gold_offer' in self.html:
self.account.relogin(self.user)
self.retry()
- link = unquote(
- re.search('<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"', self.html).group(1))
- self.download(link, disposition=True)
+ else:
+ link = re.search(self.PREMIUM_LINK_PATTERN, self.html)
+ mirror = re.search(self.PREMIUM_MIRROR_PATTERN, self.html)
+ if link:
+ dlink = link.group(1)
+ elif mirror:
+ dlink = mirror.group(1)
+ else:
+ self.parseError("No direct download link or mirror found")
+ self.download(dlink, disposition=True)
getInfo = create_getInfo(DepositfilesCom)
diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py
index 998dcd606..e25de18b4 100644
--- a/module/plugins/hoster/DlFreeFr.py
+++ b/module/plugins/hoster/DlFreeFr.py
@@ -1,23 +1,25 @@
# -*- coding: utf-8 -*-
-import re
import pycurl
+import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns
from module.common.json_layer import json_loads
from module.network.Browser import Browser
from module.network.CookieJar import CookieJar
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns
class CustomBrowser(Browser):
+
def __init__(self, bucket=None, options={}):
Browser.__init__(self, bucket, options)
def load(self, *args, **kwargs):
post = kwargs.get("post")
- if post is None:
- if len(args) > 2:
- post = args[2]
+
+ if post is None and len(args) > 2:
+ post = args[2]
+
if post:
self.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
self.http.c.setopt(pycurl.POST, 1)
@@ -26,10 +28,11 @@ class CustomBrowser(Browser):
self.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
self.http.c.setopt(pycurl.POST, 0)
self.http.c.setopt(pycurl.CUSTOMREQUEST, "GET")
+
return Browser.load(self, *args, **kwargs)
-class AdYouLike():
+class AdYouLike:
"""
Class to support adyoulike captcha service
"""
@@ -43,9 +46,9 @@ class AdYouLike():
def challenge(self, html):
adyoulike_data_string = None
- found = re.search(self.ADYOULIKE_INPUT_PATTERN, html)
- if found:
- adyoulike_data_string = found.group(1)
+ m = re.search(self.ADYOULIKE_INPUT_PATTERN, html)
+ if m:
+ adyoulike_data_string = m.group(1)
else:
self.plugin.fail("Can't read AdYouLike input data")
@@ -55,13 +58,13 @@ class AdYouLike():
res = self.plugin.load(
r'http://api-ayl.appspot.com/challenge?key=%(ayl_key)s&env=%(ayl_env)s&callback=%(callback)s' % {
- "ayl_key": ayl_data[self.engine]["key"], "ayl_env": ayl_data["all"]["env"],
+ "ayl_key": ayl_data[self.engine]['key'], "ayl_env": ayl_data['all']['env'],
"callback": self.ADYOULIKE_CALLBACK})
- found = re.search(self.ADYOULIKE_CHALLENGE_PATTERN, res)
+ m = re.search(self.ADYOULIKE_CHALLENGE_PATTERN, res)
challenge_string = None
- if found:
- challenge_string = found.group(1)
+ if m:
+ challenge_string = m.group(1)
else:
self.plugin.fail("Invalid AdYouLike challenge")
challenge_data = json_loads(challenge_string)
@@ -82,10 +85,10 @@ class AdYouLike():
"""
response = None
try:
- instructions_visual = challenge["translations"][ayl["all"]["lang"]]["instructions_visual"]
- found = re.search(u".*«(.*)».*", instructions_visual)
- if found:
- response = found.group(1).strip()
+ instructions_visual = challenge['translations'][ayl['all']['lang']]['instructions_visual']
+ m = re.search(u".*«(.*)».*", instructions_visual)
+ if m:
+ response = m.group(1).strip()
else:
self.plugin.fail("Can't parse instructions visual")
except KeyError:
@@ -97,25 +100,27 @@ class AdYouLike():
self.plugin.fail("AdYouLike result failed")
return {"_ayl_captcha_engine": self.engine,
- "_ayl_env": ayl["all"]["env"],
- "_ayl_tid": challenge["tid"],
- "_ayl_token_challenge": challenge["token"],
+ "_ayl_env": ayl['all']['env'],
+ "_ayl_tid": challenge['tid'],
+ "_ayl_token_challenge": challenge['token'],
"_ayl_response": response}
class DlFreeFr(SimpleHoster):
__name__ = "DlFreeFr"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?dl\.free\.fr/([a-zA-Z0-9]+|getfile\.pl\?file=/[a-zA-Z0-9]+)'
__version__ = "0.25"
+
+ __pattern__ = r'http://(?:www\.)?dl\.free\.fr/([a-zA-Z0-9]+|getfile\.pl\?file=/[a-zA-Z0-9]+)'
+
__description__ = """Dl.free.fr hoster plugin"""
__author_name__ = ("the-razer", "zoidberg", "Toilal")
__author_mail__ = ("daniel_ AT gmx DOT net", "zoidberg@mujmail.cz", "toilal.dev@gmail.com")
- FILE_NAME_PATTERN = r"Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>"
- FILE_SIZE_PATTERN = r"Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o"
- FILE_OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demand&eacute; n'a pas &eacute;t&eacute; trouv&eacute;"
- #FILE_URL_PATTERN = r'href="(?P<url>http://.*?)">T&eacute;l&eacute;charger ce fichier'
+ FILE_NAME_PATTERN = r'Fichier:</td>\s*<td[^>]*>(?P<N>[^>]*)</td>'
+ FILE_SIZE_PATTERN = r'Taille:</td>\s*<td[^>]*>(?P<S>[\d.]+[KMG])o'
+ OFFLINE_PATTERN = r"Erreur 404 - Document non trouv|Fichier inexistant|Le fichier demand&eacute; n'a pas &eacute;t&eacute; trouv&eacute;"
+
def setup(self):
self.multiDL = self.resumeDownload = True
@@ -145,7 +150,7 @@ class DlFreeFr(SimpleHoster):
self.html = self.load(valid_url)
self.handleFree()
else:
- # Direct access to requested file for users using free.fr as Internet Service Provider.
+ # Direct access to requested file for users using free.fr as Internet Service Provider.
self.download(valid_url, disposition=True)
elif headers.get('code') == 404:
self.offline()
@@ -163,10 +168,10 @@ class DlFreeFr(SimpleHoster):
self.load("http://dl.free.fr/getfile.pl", post=inputs)
headers = self.getLastHeaders()
if headers.get("code") == 302 and "set-cookie" in headers and "location" in headers:
- found = re.search("(.*?)=(.*?); path=(.*?); domain=(.*?)", headers.get("set-cookie"))
+ m = re.search("(.*?)=(.*?); path=(.*?); domain=(.*?)", headers.get("set-cookie"))
cj = CookieJar(__name__)
- if found:
- cj.setCookie(found.group(4), found.group(1), found.group(2), found.group(3))
+ if m:
+ cj.setCookie(m.group(4), m.group(1), m.group(2), m.group(3))
else:
self.fail("Cookie error")
location = headers.get("location")
diff --git a/module/plugins/hoster/DuploadOrg.py b/module/plugins/hoster/DuploadOrg.py
index 5909f7ccf..c11d694c5 100644
--- a/module/plugins/hoster/DuploadOrg.py
+++ b/module/plugins/hoster/DuploadOrg.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -20,8 +6,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class DuploadOrg(XFileSharingPro):
__name__ = "DuploadOrg"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?dupload\.org/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?dupload\.org/\w{12}'
+
__description__ = """Dupload.grg hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py
index 0ea9b186f..f9dfe6a13 100644
--- a/module/plugins/hoster/EasybytezCom.py
+++ b/module/plugins/hoster/EasybytezCom.py
@@ -1,30 +1,15 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
class EasybytezCom(XFileSharingPro):
__name__ = "EasybytezCom"
__type__ = "hoster"
+ __version__ = "0.18"
+
__pattern__ = r'http://(?:www\.)?easybytez.com/(\w+).*'
- __version__ = "0.17"
+
__description__ = """Easybytez.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
@@ -32,13 +17,13 @@ class EasybytezCom(XFileSharingPro):
HOSTER_NAME = "easybytez.com"
FILE_INFO_PATTERN = r'<span class="name">(?P<N>.+)</span><br>\s*<span class="size">(?P<S>[^<]+)</span>'
- FILE_OFFLINE_PATTERN = r'<h1>File not available</h1>'
+ OFFLINE_PATTERN = r'<h1>File not available</h1>'
- DIRECT_LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)'
- OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
- OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)'
+ LINK_PATTERN = r'(http://(\w+\.(easyload|easybytez|zingload)\.(com|to)|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)'
+ OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
ERROR_PATTERN = r'(?:class=["\']err["\'][^>]*>|<Center><b>)(.*?)</'
+
def setup(self):
self.resumeDownload = self.multiDL = self.premium
diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py
index f2d0fa206..449dc0050 100644
--- a/module/plugins/hoster/EdiskCz.py
+++ b/module/plugins/hoster/EdiskCz.py
@@ -1,40 +1,27 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class EdiskCz(SimpleHoster):
__name__ = "EdiskCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?edisk.(cz|sk|eu)/(stahni|sk/stahni|en/download)/.*'
__version__ = "0.21"
+
+ __pattern__ = r'http://(?:www\.)?edisk.(cz|sk|eu)/(stahni|sk/stahni|en/download)/.*'
+
__description__ = """Edisk.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- URL_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">'
FILE_INFO_PATTERN = r'<span class="fl" title="(?P<N>[^"]+)">\s*.*?\((?P<S>[0-9.]*) (?P<U>[kKMG])i?B\)</h1></span>'
+ OFFLINE_PATTERN = r'<h3>This file does not exist due to one of the following:</h3><ul><li>'
+
ACTION_PATTERN = r'/en/download/(\d+/.*\.html)'
- DLLINK_PATTERN = r'http://.*edisk.cz.*\.html'
- FILE_OFFLINE_PATTERN = r'<h3>This file does not exist due to one of the following:</h3><ul><li>'
+ LINK_PATTERN = r'http://.*edisk.cz.*\.html'
+
def setup(self):
self.multiDL = False
@@ -44,10 +31,10 @@ class EdiskCz(SimpleHoster):
self.logDebug('URL:' + url)
- found = re.search(self.ACTION_PATTERN, url)
- if found is None:
+ m = re.search(self.ACTION_PATTERN, url)
+ if m is None:
self.parseError("ACTION")
- action = found.group(1)
+ action = m.group(1)
self.html = self.load(url, decode=True)
self.getFileInfo()
@@ -58,7 +45,7 @@ class EdiskCz(SimpleHoster):
"action": action
})
- if not re.match(self.DLLINK_PATTERN, url):
+ if not re.match(self.LINK_PATTERN, url):
self.fail("Unexpected server response")
self.download(url)
diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py
index 68a95b33a..547f042e4 100644
--- a/module/plugins/hoster/EgoFilesCom.py
+++ b/module/plugins/hoster/EgoFilesCom.py
@@ -1,42 +1,31 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test link (random.bin):
+#
+# Test links:
# http://egofiles.com/mOZfMI1WLZ6HBkGG/random.bin
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class EgoFilesCom(SimpleHoster):
__name__ = "EgoFilesCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)'
__version__ = "0.15"
+
+ __pattern__ = r'https?://(?:www\.)?egofiles.com/(\w+)'
+
__description__ = """Egofiles.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>[^\t]+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|'
- FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB'
+ OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB'
WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>'
- DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>'
- RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX'
+ LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>'
+ RECAPTCHA_KEY = "6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX"
+
def setup(self):
# Set English language
@@ -58,15 +47,15 @@ class EgoFilesCom(SimpleHoster):
waittime = int(m['m']) * 60 + int(m['s'])
self.wait(waittime, True)
- downloadURL = ''
+ downloadURL = r''
recaptcha = ReCaptcha(self)
for _ in xrange(5):
challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
post_data = {'recaptcha_challenge_field': challenge,
'recaptcha_response_field': response}
self.html = self.load(self.pyfile.url, post=post_data, decode=True)
- m = re.search(self.DIRECT_LINK_PATTERN, self.html)
- if not m:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.logInfo('Wrong captcha')
self.invalidCaptcha()
elif hasattr(m, 'group'):
@@ -90,7 +79,7 @@ class EgoFilesCom(SimpleHoster):
self.html = self.load(self.pyfile.url, decode=True)
self.getFileInfo()
m = re.search(r'<a href="(?P<link>[^"]+)">Download ></a>', self.html)
- if not m:
+ if m is None:
self.parseError('Unable to detect direct download url')
else:
self.logDebug('DIRECT URL from html: ' + m.group('link'))
diff --git a/module/plugins/hoster/EpicShareNet.py b/module/plugins/hoster/EpicShareNet.py
index 65e9cb5c3..73b16c08e 100644
--- a/module/plugins/hoster/EpicShareNet.py
+++ b/module/plugins/hoster/EpicShareNet.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-
+#
# Test links:
# BigBuckBunny_320x180.mp4 - 61.7 Mb - http://epicshare.net/fch3m2bk6ihp/BigBuckBunny_320x180.mp4.html
@@ -9,15 +9,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class EpicShareNet(XFileSharingPro):
__name__ = "EpicShareNet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?epicshare\.net/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?epicshare\.net/\w{12}'
+
__description__ = """EpicShare.net hoster plugin"""
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
HOSTER_NAME = "epicshare.net"
- FILE_OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>'
+ OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>'
FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h2>(?P<N>[^<]+)</h2>'
diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py
index fa6342014..fdb76cd5c 100644
--- a/module/plugins/hoster/EuroshareEu.py
+++ b/module/plugins/hoster/EuroshareEu.py
@@ -1,37 +1,23 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class EuroshareEu(SimpleHoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*'
__version__ = "0.25"
+
+ __pattern__ = r'http://(?:www\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*'
+
__description__ = """Euroshare.eu hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_INFO_PATTERN = r'<span style="float: left;"><strong>(?P<N>.+?)</strong> \((?P<S>.+?)\)</span>'
- FILE_OFFLINE_PATTERN = ur'<h2>S.bor sa nena.iel</h2>|Poşadovaná stránka neexistuje!'
+ OFFLINE_PATTERN = ur'<h2>S.bor sa nena.iel</h2>|Poşadovaná stránka neexistuje!'
FREE_URL_PATTERN = r'<a href="(/file/\d+/[^/]*/download/)"><div class="downloadButton"'
ERR_PARDL_PATTERN = r'<h2>Prebieha s.ahovanie</h2>|<p>Naraz je z jednej IP adresy mo.n. s.ahova. iba jeden s.bor'
@@ -39,6 +25,7 @@ class EuroshareEu(SimpleHoster):
FILE_URL_REPLACEMENTS = [(r"(http://[^/]*\.)(sk|cz|hu|pl)/", r"\1eu/")]
+
def setup(self):
self.multiDL = self.resumeDownload = self.premium
self.req.setOption("timeout", 120)
@@ -62,10 +49,10 @@ class EuroshareEu(SimpleHoster):
if re.search(self.ERR_PARDL_PATTERN, self.html) is not None:
self.longWait(5 * 60, 12)
- found = re.search(self.FREE_URL_PATTERN, self.html)
- if found is None:
+ m = re.search(self.FREE_URL_PATTERN, self.html)
+ if m is None:
self.parseError("Parse error (URL)")
- parsed_url = "http://euroshare.eu%s" % found.group(1)
+ parsed_url = "http://euroshare.eu%s" % m.group(1)
self.logDebug("URL", parsed_url)
self.download(parsed_url, disposition=True)
diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py
index 4dba81a8f..2409d8517 100644
--- a/module/plugins/hoster/ExtabitCom.py
+++ b/module/plugins/hoster/ExtabitCom.py
@@ -1,44 +1,32 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.plugins.internal.CaptchaService import ReCaptcha
from module.common.json_layer import json_loads
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
+from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
class ExtabitCom(SimpleHoster):
__name__ = "ExtabitCom"
__type__ = "hoster"
+ __version__ = "0.6"
+
__pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P<ID>\w+)'
- __version__ = "0.5"
+
__description__ = """Extabit.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<th>File:</th>\s*<td class="col-fileinfo">\s*<div title="(?P<N>[^"]+)">'
FILE_SIZE_PATTERN = r'<th>Size:</th>\s*<td class="col-fileinfo">(?P<S>[^<]+)</td>'
- FILE_OFFLINE_PATTERN = r'>File not found<'
- TEMP_OFFLINE_PATTERN = r">(File is temporary unavailable|No download mirror)<"
+ OFFLINE_PATTERN = r'>File not found<'
+ TEMP_OFFLINE_PATTERN = r'>(File is temporary unavailable|No download mirror)<'
+
+ LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]'
- DOWNLOAD_LINK_PATTERN = r'[\'"](http://guest\d+\.extabit\.com/[a-z0-9]+/.*?)[\'"]'
def handleFree(self):
if r">Only premium users can download this file" in self.html:
@@ -48,7 +36,8 @@ class ExtabitCom(SimpleHoster):
if m:
self.wait(int(m.group(1)) * 60, True)
elif "The daily downloads limit from your IP is exceeded" in self.html:
- self.wait(1 * 60 * 60, True)
+ self.logWarning("You have reached your daily downloads limit for today")
+ self.wait(secondsToMidnight(gmt=2), True)
self.logDebug("URL: " + self.req.http.lastEffectiveURL)
m = re.match(self.__pattern__, self.req.http.lastEffectiveURL)
@@ -61,7 +50,7 @@ class ExtabitCom(SimpleHoster):
for _ in xrange(5):
get_data = {"type": "recaptcha"}
- get_data["challenge"], get_data["capture"] = recaptcha.challenge(captcha_key)
+ get_data['challenge'], get_data['capture'] = recaptcha.challenge(captcha_key)
response = json_loads(self.load("http://extabit.com/file/%s/" % fileID, get=get_data))
if "ok" in response:
self.correctCaptcha()
@@ -77,8 +66,8 @@ class ExtabitCom(SimpleHoster):
self.parseError('JSON')
self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href']))
- m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if not m:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError('Download URL')
url = m.group(1)
self.logDebug("Download URL: " + url)
diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py
index 8eeabc17c..199544840 100644
--- a/module/plugins/hoster/FastixRu.py
+++ b/module/plugins/hoster/FastixRu.py
@@ -1,21 +1,26 @@
# -*- coding: utf-8 -*-
import re
-from urllib import unquote
+
from random import randrange
-from module.plugins.Hoster import Hoster
+from urllib import unquote
+
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
class FastixRu(Hoster):
__name__ = "FastixRu"
- __version__ = "0.04"
__type__ = "hoster"
+ __version__ = "0.04"
+
__pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P<ID>[a-zA-Z0-9]{24})'
+
__description__ = """Fastix hoster plugin"""
__author_name__ = "Massimo Rosamilia"
__author_mail__ = "max@spiritix.eu"
+
def getFilename(self, url):
try:
name = unquote(url.rsplit("/", 1)[1])
@@ -38,7 +43,7 @@ class FastixRu(Hoster):
else:
self.logDebug("Old URL: %s" % pyfile.url)
api_key = self.account.getAccountData(self.user)
- api_key = api_key["api"]
+ api_key = api_key['api']
url = "http://fastix.ru/api_v2/?apikey=%s&sub=getdirectlink&link=%s" % (api_key, pyfile.url)
page = self.load(url)
data = json_loads(page)
@@ -46,7 +51,7 @@ class FastixRu(Hoster):
if "error\":true" in page:
self.offline()
else:
- new_url = data["downloadlink"]
+ new_url = data['downloadlink']
if new_url != pyfile.url:
self.logDebug("New URL: %s" % new_url)
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index c7841a237..7a847fdc4 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -1,25 +1,10 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: zoidberg
-###############################################################################
-
-# Test links (random.bin):
+# Test links:
# http://www.fastshare.cz/2141189/random.bin
import re
+
from urlparse import urljoin
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -28,29 +13,33 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FastshareCz(SimpleHoster):
__name__ = "FastshareCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+'
__version__ = "0.22"
+
+ __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+'
+
__description__ = """FastShare.cz hoster plugin"""
__author_name__ = ("zoidberg", "stickell", "Walter Purcaro")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com")
FILE_INFO_PATTERN = r'<h1 class="dwp">(?P<N>[^<]+)</h1>\s*<div class="fileinfo">\s*Size\s*: (?P<S>\d+) (?P<U>\w+),'
- FILE_OFFLINE_PATTERN = '>(The file has been deleted|Requested page not found)'
+ OFFLINE_PATTERN = r'>(The file has been deleted|Requested page not found)'
FILE_URL_REPLACEMENTS = [("#.*", "")]
+
SH_COOKIES = [(".fastshare.cz", "lang", "en")]
FREE_URL_PATTERN = r'action=(/free/.*?)>\s*<img src="([^"]*)"><br'
PREMIUM_URL_PATTERN = r'(http://data\d+\.fastshare\.cz/download\.php\?id=\d+&)'
- CREDIT_PATTERN = " credit for "
+ CREDIT_PATTERN = r' credit for '
+
def handleFree(self):
if "> 100% of FREE slots are full" in self.html:
self.retry(120, 60, "No free slots")
- found = re.search(self.FREE_URL_PATTERN, self.html)
- if found:
- action, captcha_src = found.groups()
+ m = re.search(self.FREE_URL_PATTERN, self.html)
+ if m:
+ action, captcha_src = m.groups()
else:
self.parseError("Free URL")
@@ -72,7 +61,7 @@ class FastshareCz(SimpleHoster):
def handlePremium(self):
header = self.load(self.pyfile.url, just_header=True)
if "location" in header:
- url = header["location"]
+ url = header['location']
else:
self.html = self.load(self.pyfile.url)
@@ -82,9 +71,9 @@ class FastshareCz(SimpleHoster):
self.logWarning("Not enough traffic left")
self.resetAccount()
else:
- found = re.search(self.PREMIUM_URL_PATTERN, self.html)
- if found:
- url = found.group(1)
+ m = re.search(self.PREMIUM_URL_PATTERN, self.html)
+ if m:
+ url = m.group(1)
else:
self.parseError("Premium URL")
diff --git a/module/plugins/hoster/File4safeCom.py b/module/plugins/hoster/File4safeCom.py
index 9e06972e2..7ec775103 100644
--- a/module/plugins/hoster/File4safeCom.py
+++ b/module/plugins/hoster/File4safeCom.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
+
from pycurl import FOLLOWLOCATION
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -9,14 +10,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class File4safeCom(XFileSharingPro):
__name__ = "File4safeCom"
__type__ = "hoster"
+ __version__ = "0.02"
+
__pattern__ = r'https?://(?:www\.)?file4safe\.com/\w+'
- __version__ = "0.01"
+
__description__ = """File4safe.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
HOSTER_NAME = "file4safe.com"
+
def handlePremium(self):
self.req.http.lastURL = self.pyfile.url
@@ -25,9 +29,9 @@ class File4safeCom(XFileSharingPro):
self.header = self.req.http.header
self.req.http.c.setopt(FOLLOWLOCATION, 1)
- found = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
- if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
- location = found.group(1).strip()
+ m = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
+ if m and re.match(self.LINK_PATTERN, m.group(1)):
+ location = m.group(1).strip()
self.startDownload(location)
else:
self.parseError("Unable to detect premium download link")
diff --git a/module/plugins/hoster/FileApeCom.py b/module/plugins/hoster/FileApeCom.py
index 34b4acd07..91744c7c2 100644
--- a/module/plugins/hoster/FileApeCom.py
+++ b/module/plugins/hoster/FileApeCom.py
@@ -6,11 +6,13 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class FileApeCom(DeadHoster):
__name__ = "FileApeCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?fileape\.com/(index\.php\?act=download\&id=|dl/)\w+'
__version__ = "0.12"
+
+ __pattern__ = r'http://(?:www\.)?fileape\.com/(index\.php\?act=download\&id=|dl/)\w+'
+
__description__ = """FileApe.com hoster plugin"""
__author_name__ = "espes"
- __author_mail__ = ""
+ __author_mail__ = None
getInfo = create_getInfo(FileApeCom)
diff --git a/module/plugins/hoster/FileParadoxIn.py b/module/plugins/hoster/FileParadoxIn.py
new file mode 100644
index 000000000..d6395b130
--- /dev/null
+++ b/module/plugins/hoster/FileParadoxIn.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+
+
+class FileParadoxIn(XFileSharingPro):
+ __name__ = "FileParadoxIn"
+ __type__ = "hoster"
+ __version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?fileparadox\.in/\w+'
+
+ __description__ = """FileParadox.in hoster plugin"""
+ __author_name__ = "RazorWing"
+ __author_mail__ = "muppetuk1@hotmail.com"
+
+ HOSTER_NAME = "fileparadox.in"
+
+ FILE_SIZE_PATTERN = r'</font>\s*\(\s*(?P<S>[^)]+)\s*\)</font>'
+ LINK_PATTERN = r'(http://([^/]*?fileparadox.in|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)'
+
+
+getInfo = create_getInfo(FileParadoxIn)
diff --git a/module/plugins/hoster/FileStoreTo.py b/module/plugins/hoster/FileStoreTo.py
index 5a73fb9ef..98d67609a 100644
--- a/module/plugins/hoster/FileStoreTo.py
+++ b/module/plugins/hoster/FileStoreTo.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Walter Purcaro
-"""
-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -25,14 +8,17 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FileStoreTo(SimpleHoster):
__name__ = "FileStoreTo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?filestore\.to/\?d=(?P<ID>\w+)'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?filestore\.to/\?d=(?P<ID>\w+)'
+
__description__ = """FileStore.to hoster plugin"""
__author_name__ = ("Walter Purcaro", "stickell")
__author_mail__ = ("vuolter@gmail.com", "l.stickell@yahoo.it")
FILE_INFO_PATTERN = r'File: <span[^>]*>(?P<N>.+)</span><br />Size: (?P<S>[\d,.]+) (?P<U>\w+)'
- FILE_OFFLINE_PATTERN = r'>Download-Datei wurde nicht gefunden<'
+ OFFLINE_PATTERN = r'>Download-Datei wurde nicht gefunden<'
+
def setup(self):
self.resumeDownload = self.multiDL = True
diff --git a/module/plugins/hoster/FilebeerInfo.py b/module/plugins/hoster/FilebeerInfo.py
index dd26b9120..3e8cfb6a3 100644
--- a/module/plugins/hoster/FilebeerInfo.py
+++ b/module/plugins/hoster/FilebeerInfo.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class FilebeerInfo(DeadHoster):
__name__ = "FilebeerInfo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?filebeer\.info/(?!\d*~f)(?P<ID>\w+).*'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?filebeer\.info/(?!\d*~f)(?P<ID>\w+).*'
+
__description__ = """Filebeer.info plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py
index 56eedf33a..025bd483f 100644
--- a/module/plugins/hoster/FilecloudIo.py
+++ b/module/plugins/hoster/FilecloudIo.py
@@ -1,48 +1,35 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
+
from module.common.json_layer import json_loads
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilecloudIo(SimpleHoster):
__name__ = "FilecloudIo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(?:filecloud\.io|ifile\.it|mihd\.net)/(?P<ID>\w+).*'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?(?:filecloud\.io|ifile\.it|mihd\.net)/(?P<ID>\w+).*'
+
__description__ = """Filecloud.io hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
FILE_SIZE_PATTERN = r'{var __ab1 = (?P<S>\d+);}'
FILE_NAME_PATTERN = r'id="aliasSpan">(?P<N>.*?)&nbsp;&nbsp;<'
- FILE_OFFLINE_PATTERN = r'l10n.(FILES__DOESNT_EXIST|REMOVED)'
+ OFFLINE_PATTERN = r'l10n.(FILES__DOESNT_EXIST|REMOVED)'
TEMP_OFFLINE_PATTERN = r'l10n.FILES__WARNING'
UKEY_PATTERN = r"'ukey'\s*:'(\w+)',"
AB1_PATTERN = r"if\( __ab1 == '(\w+)' \)"
- ERROR_MSG_PATTERN = r"var __error_msg\s*=\s*l10n\.(.*?);"
- DOWNLOAD_LINK_PATTERN = r'"(http://s\d+.filecloud.io/%s/\d+/.*?)"'
+ ERROR_MSG_PATTERN = r'var __error_msg\s*=\s*l10n\.(.*?);'
+ LINK_PATTERN = r'"(http://s\d+.filecloud.io/%s/\d+/.*?)"'
RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';"
- RECAPTCHA_KEY = '6Lf5OdISAAAAAEZObLcx5Wlv4daMaASRov1ysDB1'
+ RECAPTCHA_KEY = "6Lf5OdISAAAAAEZObLcx5Wlv4daMaASRov1ysDB1"
+
def setup(self):
self.resumeDownload = self.multiDL = True
@@ -51,10 +38,10 @@ class FilecloudIo(SimpleHoster):
def handleFree(self):
data = {"ukey": self.file_info['ID']}
- found = re.search(self.AB1_PATTERN, self.html)
- if not found:
- raise PluginParseError("__AB1")
- data["__ab1"] = found.group(1)
+ m = re.search(self.AB1_PATTERN, self.html)
+ if m is None:
+ self.parseError("__AB1")
+ data['__ab1'] = m.group(1)
if not self.account:
self.fail("User not logged in")
@@ -71,25 +58,25 @@ class FilecloudIo(SimpleHoster):
self.logDebug(response)
response = json_loads(response)
- if "error" in response and response["error"]:
+ if "error" in response and response['error']:
self.fail(response)
self.logDebug(response)
- if response["captcha"]:
+ if response['captcha']:
recaptcha = ReCaptcha(self)
- found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
- captcha_key = found.group(1) if found else self.RECAPTCHA_KEY
- data["ctype"] = "recaptcha"
+ m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
+ captcha_key = m.group(1) if m else self.RECAPTCHA_KEY
+ data['ctype'] = "recaptcha"
for _ in xrange(5):
- data["recaptcha_challenge"], data["recaptcha_response"] = recaptcha.challenge(captcha_key)
+ data['recaptcha_challenge'], data['recaptcha_response'] = recaptcha.challenge(captcha_key)
json_url = "http://filecloud.io/download-request.json"
response = self.load(json_url, post=data)
self.logDebug(response)
response = json_loads(response)
- if "retry" in response and response["retry"]:
+ if "retry" in response and response['retry']:
self.invalidCaptcha()
else:
self.correctCaptcha()
@@ -97,12 +84,12 @@ class FilecloudIo(SimpleHoster):
else:
self.fail("Incorrect captcha")
- if response["dl"]:
+ if response['dl']:
self.html = self.load('http://filecloud.io/download.html')
- found = re.search(self.DOWNLOAD_LINK_PATTERN % self.file_info['ID'], self.html)
- if not found:
- raise PluginParseError("Download URL")
- download_url = found.group(1)
+ m = re.search(self.LINK_PATTERN % self.file_info['ID'], self.html)
+ if m is None:
+ self.parseError("Download URL")
+ download_url = m.group(1)
self.logDebug("Download URL: %s" % download_url)
if "size" in self.file_info and self.file_info['size']:
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index 21b803649..1ac7550fc 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -1,38 +1,41 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from module.network.RequestFactory import getURL
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
+
+
+def getInfo(urls):
+ for url in urls:
+ h = getURL(url, just_header=True)
+ m = re.search(r'Location: (.+)\r\n', h)
+ if m and not re.match(m.group(1), FilefactoryCom.__pattern__): # It's a direct link! Skipping
+ yield (url, 0, 3, url)
+ else: # It's a standard html page
+ file_info = parseFileInfo(FilefactoryCom, url, getURL(url))
+ yield file_info
class FilefactoryCom(SimpleHoster):
__name__ = "FilefactoryCom"
__type__ = "hoster"
+ __version__ = "0.50"
+
__pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+)'
- __version__ = "0.48"
+
__description__ = """Filefactory.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
FILE_INFO_PATTERN = r'<div id="file_name"[^>]*>\s*<h2>(?P<N>[^<]+)</h2>\s*<div id="file_info">\s*(?P<S>[\d.]+) (?P<U>\w+) uploaded'
- DIRECT_LINK_PATTERN = r'<a href="(https?://[^"]+)"[^>]*><i[^>]*></i> Download with FileFactory Premium</a>'
- FILE_OFFLINE_PATTERN = r'<h2>File Removed</h2>'
+ LINK_PATTERN = r'<a href="(https?://[^"]+)"[^>]*><i[^>]*></i> Download with FileFactory Premium</a>'
+ OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available'
PREMIUM_ONLY_PATTERN = r'>Premium Account Required<'
+ SH_COOKIES = [(".filefactory.com", "locale", "en_US.utf8")]
+
+
def handleFree(self):
self.html = self.load(self.pyfile.url, decode=True)
if "Currently only Premium Members can download files larger than" in self.html:
@@ -53,7 +56,7 @@ class FilefactoryCom(SimpleHoster):
else: # This section could be completely useless now
# Load the page that contains the direct link
url = re.search(r"document\.location\.host \+\s*'(.+)';", self.html)
- if not url:
+ if url is None:
self.parseError('Unable to detect free link')
url = 'http://www.filefactory.com' + url.group(1)
self.html = self.load(url, decode=True)
@@ -93,14 +96,11 @@ class FilefactoryCom(SimpleHoster):
else:
self.logInfo('You could enable "Direct Downloads" on http://filefactory.com/account/')
html = self.load(self.pyfile.url)
- found = re.search(self.DIRECT_LINK_PATTERN, html)
- if found:
- url = found.group(1)
+ m = re.search(self.LINK_PATTERN, html)
+ if m:
+ url = m.group(1)
else:
self.parseError('Unable to detect premium direct link')
self.logDebug('DIRECT PREMIUM LINK: ' + url)
self.download(url, disposition=True)
-
-
-getInfo = create_getInfo(FilefactoryCom)
diff --git a/module/plugins/hoster/FilejungleCom.py b/module/plugins/hoster/FilejungleCom.py
index 910798bf6..9380be90e 100644
--- a/module/plugins/hoster/FilejungleCom.py
+++ b/module/plugins/hoster/FilejungleCom.py
@@ -1,22 +1,5 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.hoster.FileserveCom import FileserveCom, checkFile
from module.plugins.Plugin import chunks
@@ -24,14 +7,16 @@ from module.plugins.Plugin import chunks
class FilejungleCom(FileserveCom):
__name__ = "FilejungleCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?filejungle\.com/f/(?P<id>[^/]+).*'
__version__ = "0.51"
+
+ __pattern__ = r'http://(?:www\.)?filejungle\.com/f/(?P<id>[^/]+).*'
+
__description__ = """Filejungle.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- URLS = ['http://www.filejungle.com/f/', 'http://www.filejungle.com/check_links.php',
- 'http://www.filejungle.com/checkReCaptcha.php']
+ URLS = ["http://www.filejungle.com/f/", "http://www.filejungle.com/check_links.php",
+ "http://www.filejungle.com/checkReCaptcha.php"]
LINKCHECK_TR = r'<li>\s*(<div class="col1">.*?)</li>'
LINKCHECK_TD = r'<div class="(?:col )?col\d">(?:<[^>]*>|&nbsp;)*([^<]*)'
diff --git a/module/plugins/hoster/FileomCom.py b/module/plugins/hoster/FileomCom.py
index 9fda2353c..2f876466b 100644
--- a/module/plugins/hoster/FileomCom.py
+++ b/module/plugins/hoster/FileomCom.py
@@ -1,22 +1,6 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
-
-# Test links (random.bin):
+# Test links:
# http://fileom.com/gycaytyzdw3g/random.bin.html
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -25,8 +9,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class FileomCom(XFileSharingPro):
__name__ = "FileomCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?fileom\.com/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?fileom\.com/\w+'
+
__description__ = """Fileom.com hoster plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
@@ -41,7 +27,8 @@ class FileomCom(XFileSharingPro):
ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)(?:\'|</)'
- DIRECT_LINK_PATTERN = r"var url2 = '(.+?)';"
+ LINK_PATTERN = r"var url2 = '(.+?)';"
+
def setup(self):
self.resumeDownload = self.premium
diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py
index 01ac76850..0e1b6ea5a 100644
--- a/module/plugins/hoster/FilepostCom.py
+++ b/module/plugins/hoster/FilepostCom.py
@@ -1,63 +1,46 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-
- changelog:
- 0.27 - 2012-08-12 - hgg
- fix "global name 'js_answer' is not defined" bug
- fix captcha bug #1 (failed on non-english "captcha wrong" errors)
-"""
-
import re
+
from time import time
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.plugins.internal.CaptchaService import ReCaptcha
from module.common.json_layer import json_loads
+from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilepostCom(SimpleHoster):
__name__ = "FilepostCom"
__type__ = "hoster"
+ __version__ = "0.28"
+
__pattern__ = r'https?://(?:www\.)?(?:filepost\.com/files|fp.io)/([^/]+).*'
- __version__ = "0.27"
+
__description__ = """Filepost.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_INFO_PATTERN = r'<input type="text" id="url" value=\'<a href[^>]*>(?P<N>[^>]+?) - (?P<S>[0-9\.]+ [kKMG]i?B)</a>\' class="inp_text"/>'
- #FILE_INFO_PATTERN = r'<h1>(?P<N>[^<]+)</h1>\s*<div class="ul">\s*<ul>\s*<li><span>Size:</span> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B</li>'
- FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>|<div class="file_info file_info_deleted">'
+ OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>|<div class="file_info file_info_deleted">'
+
+ PREMIUM_ONLY_PATTERN = r'members only. Please upgrade to premium|a premium membership is required to download this file'
RECAPTCHA_KEY_PATTERN = r"Captcha.init\({\s*key:\s*'([^']+)'"
FLP_TOKEN_PATTERN = r"set_store_options\({token: '([^']+)'"
+
def handleFree(self):
# Find token and captcha key
file_id = re.match(self.__pattern__, self.pyfile.url).group(1)
- found = re.search(self.FLP_TOKEN_PATTERN, self.html)
- if not found:
+ m = re.search(self.FLP_TOKEN_PATTERN, self.html)
+ if m is None:
self.parseError("Token")
- flp_token = found.group(1)
+ flp_token = m.group(1)
- found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
- if not found:
+ m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
+ if m is None:
self.parseError("Captcha key")
- captcha_key = found.group(1)
+ captcha_key = m.group(1)
# Get wait time
get_dict = {'SID': self.req.cj.getCookie('SID'), 'JsHttpRequest': str(int(time() * 10000)) + '-xml'}
@@ -70,7 +53,7 @@ class FilepostCom(SimpleHoster):
post_dict = {"token": flp_token, "code": file_id, "file_pass": ''}
if 'var is_pass_exists = true;' in self.html:
- # Solve password
+ # Solve password
for file_pass in self.getPassword().splitlines():
get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml'
post_dict['file_pass'] = file_pass
@@ -90,10 +73,10 @@ class FilepostCom(SimpleHoster):
for i in xrange(5):
get_dict['JsHttpRequest'] = str(int(time() * 10000)) + '-xml'
if i:
- post_dict["recaptcha_challenge_field"], post_dict["recaptcha_response_field"] = recaptcha.challenge(
+ post_dict['recaptcha_challenge_field'], post_dict['recaptcha_response_field'] = recaptcha.challenge(
captcha_key)
self.logDebug(u"RECAPTCHA: %s : %s : %s" % (
- captcha_key, post_dict["recaptcha_challenge_field"], post_dict["recaptcha_response_field"]))
+ captcha_key, post_dict['recaptcha_challenge_field'], post_dict['recaptcha_response_field']))
download_url = self.getJsonResponse(get_dict, post_dict, 'link')
if download_url:
diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py
index d39666922..a36607f8a 100644
--- a/module/plugins/hoster/FilerNet.py
+++ b/module/plugins/hoster/FilerNet.py
@@ -1,44 +1,34 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test links (random.bin):
+#
+# Test links:
# http://filer.net/get/ivgf5ztw53et3ogd
# http://filer.net/get/hgo14gzcng3scbvv
import pycurl
import re
+
from urlparse import urljoin
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilerNet(SimpleHoster):
__name__ = "FilerNet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)'
__version__ = "0.03"
+
+ __pattern__ = r'https?://(?:www\.)?filer\.net/get/(\w+)'
+
__description__ = """Filer.net hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
FILE_INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>\w+)</small></h1>'
- FILE_OFFLINE_PATTERN = r'Nicht gefunden'
- RECAPTCHA_KEY = '6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V'
- DIRECT_LINK_PATTERN = r'href="([^"]+)">Get download</a>'
+ OFFLINE_PATTERN = r'Nicht gefunden'
+ RECAPTCHA_KEY = "6LcFctISAAAAAAgaeHgyqhNecGJJRnxV1m_vAz3V"
+ LINK_PATTERN = r'href="([^"]+)">Get download</a>'
+
def process(self, pyfile):
if self.premium and (not self.SH_CHECK_TRAFFIC or self.checkTrafficLeft()):
@@ -74,7 +64,7 @@ class FilerNet(SimpleHoster):
hash_data = inputs['hash']
self.logDebug('Hash: ' + hash_data)
- downloadURL = ''
+ downloadURL = r''
recaptcha = ReCaptcha(self)
for _ in xrange(5):
challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
@@ -107,8 +97,8 @@ class FilerNet(SimpleHoster):
dl = self.pyfile.url
else: # Direct Download OFF
html = self.load(self.pyfile.url)
- m = re.search(self.DIRECT_LINK_PATTERN, html)
- if not m:
+ m = re.search(self.LINK_PATTERN, html)
+ if m is None:
self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings")
dl = 'http://filer.net' + m.group(1)
diff --git a/module/plugins/hoster/FilerioCom.py b/module/plugins/hoster/FilerioCom.py
index a0c67509f..5cac34b04 100644
--- a/module/plugins/hoster/FilerioCom.py
+++ b/module/plugins/hoster/FilerioCom.py
@@ -6,17 +6,20 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class FilerioCom(XFileSharingPro):
__name__ = "FilerioCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(filerio\.(in|com)|filekeen\.com)/\w{12}'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?(filerio\.(in|com)|filekeen\.com)/\w{12}'
+
__description__ = """FileRio.in hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
HOSTER_NAME = "filerio.in"
- FILE_OFFLINE_PATTERN = '<b>&quot;File Not Found&quot;</b>|File has been removed due to Copyright Claim'
+ OFFLINE_PATTERN = r'<b>&quot;File Not Found&quot;</b>|File has been removed due to Copyright Claim'
FILE_URL_REPLACEMENTS = [(r'http://.*?/', 'http://filerio.in/')]
+
def setup(self):
self.resumeDownload = self.multiDL = self.premium
diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py
index 34998726d..bbb6fa57b 100644
--- a/module/plugins/hoster/FilesMailRu.py
+++ b/module/plugins/hoster/FilesMailRu.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Hoster import Hoster
+
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
@@ -31,12 +32,15 @@ def getInfo(urls):
class FilesMailRu(Hoster):
__name__ = "FilesMailRu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?files\.mail\.ru/.*'
__version__ = "0.31"
+
+ __pattern__ = r'http://(?:www\.)?files\.mail\.ru/.*'
+
__description__ = """Files.mail.ru hoster plugin"""
__author_name__ = "oZiRiz"
__author_mail__ = "ich@oziriz.de"
+
def setup(self):
if not self.account:
self.multiDL = False
@@ -72,14 +76,11 @@ class FilesMailRu(Hoster):
def getFileUrl(self):
"""gives you the URL to the file. Extracted from the Files.mail.ru HTML-page stored in self.html"""
- file_url = re.search(self.url_pattern, self.html).group(0).split('<a href="')[1].split('" onclick="return Act')[
- 0]
- return file_url
+ return re.search(self.url_pattern, self.html).group(0).split('<a href="')[1].split('" onclick="return Act')[0]
def getFileName(self):
"""gives you the Name for each file. Also extracted from the HTML-Page"""
- file_name = re.search(self.url_pattern, self.html).group(0).split(', event)">')[1].split('</a>')[0]
- return file_name
+ return re.search(self.url_pattern, self.html).group(0).split(', event)">')[1].split('</a>')[0]
def myPostProcess(self):
# searches the file for HTMl-Code. Sometimes the Redirect
@@ -87,7 +88,7 @@ class FilesMailRu(Hoster):
# HTML file and the Download is marked as "finished"
# then the download will be restarted. It's only bad for these
# who want download a HTML-File (it's one in a million ;-) )
- #
+ #
# The maximum UploadSize allowed on files.mail.ru at the moment is 100MB
# so i set it to check every download because sometimes there are downloads
# that contain the HTML-Text and 60MB ZEROs after that in a xyzfile.part1.rar file
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py
index 4c678c1b1..b7f051d80 100644
--- a/module/plugins/hoster/FileserveCom.py
+++ b/module/plugins/hoster/FileserveCom.py
@@ -1,27 +1,14 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-"""
-
import re
-from module.plugins.Hoster import Hoster
+
+from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
+from module.plugins.Plugin import chunks
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
-from module.common.json_layer import json_loads
from module.utils import parseFileSize
-from module.plugins.Plugin import chunks
def checkFile(plugin, urls):
@@ -46,24 +33,25 @@ def checkFile(plugin, urls):
class FileserveCom(Hoster):
__name__ = "FileserveCom"
__type__ = "hoster"
+ __version__ = "0.52"
+
__pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<id>[^/]+).*'
- __version__ = "0.51"
+
__description__ = """Fileserve.com hoster plugin"""
__author_name__ = ("jeix", "mkaay", "Paul King", "zoidberg")
__author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "", "zoidberg@mujmail.cz")
- URLS = ['http://www.fileserve.com/file/', 'http://www.fileserve.com/link-checker.php',
- 'http://www.fileserve.com/checkReCaptcha.php']
+ URLS = ["http://www.fileserve.com/file/", "http://www.fileserve.com/link-checker.php",
+ "http://www.fileserve.com/checkReCaptcha.php"]
LINKCHECK_TR = r'<tr>\s*(<td>http://www.fileserve\.com/file/.*?)</tr>'
LINKCHECK_TD = r'<td>(?:<[^>]*>|&nbsp;)*([^<]*)'
CAPTCHA_KEY_PATTERN = r"var reCAPTCHA_publickey='(?P<key>[^']+)'"
LONG_WAIT_PATTERN = r'<li class="title">You need to wait (\d+) (\w+) to start another download\.</li>'
- LINK_EXPIRED_PATTERN = "Your download link has expired"
- DAILY_LIMIT_PATTERN = "Your daily download limit has been reached"
- NOT_LOGGED_IN_PATTERN = '<form (name="loginDialogBoxForm"|id="login_form")|<li><a href="/login.php">Login</a></li>'
+ LINK_EXPIRED_PATTERN = r'Your download link has expired'
+ DAILY_LIMIT_PATTERN = r'Your daily download limit has been reached'
+ NOT_LOGGED_IN_PATTERN = r'<form (name="loginDialogBoxForm"|id="login_form")|<li><a href="/login.php">Login</a></li>'
- # shares code with FilejungleCom and UploadstationCom
def setup(self):
self.resumeDownload = self.multiDL = self.premium
@@ -90,24 +78,24 @@ class FileserveCom(Hoster):
self.logDebug(action)
if "fail" in action:
- if action["fail"] == "timeLimit":
+ if action['fail'] == "timeLimit":
self.html = self.load(self.url, post={"checkDownload": "showError", "errorType": "timeLimit"},
decode=True)
self.doLongWait(re.search(self.LONG_WAIT_PATTERN, self.html))
- elif action["fail"] == "parallelDownload":
+ elif action['fail'] == "parallelDownload":
self.logWarning(_("Parallel download error, now waiting 60s."))
self.retry(wait_time=60, reason="parallelDownload")
else:
- self.fail("Download check returned %s" % action["fail"])
+ self.fail("Download check returned %s" % action['fail'])
elif "success" in action:
- if action["success"] == "showCaptcha":
+ if action['success'] == "showCaptcha":
self.doCaptcha()
self.doTimmer()
- elif action["success"] == "showTimmer":
+ elif action['success'] == "showTimmer":
self.doTimmer()
else:
@@ -133,8 +121,8 @@ class FileserveCom(Hoster):
elif check == "wait":
self.doLongWait(self.lastCheck)
elif check == "limit":
- #download limited reached for today (not a exact time known)
- self.setWait(3 * 60 * 60, True) # wait 3 hours #TO-DO: resolve waittime using UnrestrictLi's secondsToMidnight
+ self.logWarning("Download limited reached for today")
+ self.setWait(secondsToMidnight(gmt=2), True)
self.wait()
self.retry()
@@ -148,10 +136,10 @@ class FileserveCom(Hoster):
self.fail("Failed getting wait time")
if self.__name__ == "FilejungleCom":
- found = re.search(r'"waitTime":(\d+)', response)
- if not found:
+ m = re.search(r'"waitTime":(\d+)', response)
+ if m is None:
self.fail("Cannot get wait time")
- wait_time = int(found.group(1))
+ wait_time = int(m.group(1))
else:
wait_time = int(response) + 3
@@ -170,7 +158,7 @@ class FileserveCom(Hoster):
'recaptcha_response_field': code,
'recaptcha_shortencode_field': self.file_id}))
self.logDebug("reCaptcha response : %s" % response)
- if not response["success"]:
+ if not response['success']:
self.invalidCaptcha()
else:
self.correctCaptcha()
@@ -190,7 +178,7 @@ class FileserveCom(Hoster):
#try api download
response = self.load("http://app.fileserve.com/api/download/premium/",
post={"username": self.user,
- "password": self.account.getAccountData(self.user)["password"],
+ "password": self.account.getAccountData(self.user)['password'],
"shorten": self.file_id},
decode=True)
if response:
diff --git a/module/plugins/hoster/FileshareInUa.py b/module/plugins/hoster/FileshareInUa.py
index db2b1a998..f76942f6d 100644
--- a/module/plugins/hoster/FileshareInUa.py
+++ b/module/plugins/hoster/FileshareInUa.py
@@ -1,23 +1,27 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Hoster import Hoster
+
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
from module.utils import parseFileSize
class FileshareInUa(Hoster):
__name__ = "FileshareInUa"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?fileshare.in.ua/[A-Za-z0-9]+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?fileshare.in.ua/[A-Za-z0-9]+'
+
__description__ = """Fileshare.in.ua hoster plugin"""
__author_name__ = "fwannmacher"
__author_mail__ = "felipe@warhammerproject.com"
PATTERN_FILENAME = r'<h3 class="b-filename">(.*?)</h3>'
PATTERN_FILESIZE = r'<b class="b-filesize">(.*?)</b>'
- PATTERN_OFFLINE = "This file doesn't exist, or has been removed."
+ PATTERN_OFFLINE = r"This file doesn't exist, or has been removed."
+
def setup(self):
self.resumeDownload = self.multiDL = True
@@ -31,12 +35,12 @@ class FileshareInUa(Hoster):
pyfile.name = self._getName()
- self.link = self._getLink()
+ link = self._getLink()
- if not self.link.startswith('http://'):
- self.link = "http://fileshare.in.ua" + self.link
+ if not link.startswith('http://'):
+ link = "http://fileshare.in.ua" + link
- self.download(self.link)
+ self.download(link)
def _checkOnline(self):
if re.search(self.PATTERN_OFFLINE, self.html):
diff --git a/module/plugins/hoster/FilezyNet.py b/module/plugins/hoster/FilezyNet.py
index cd0902ab3..969007a8a 100644
--- a/module/plugins/hoster/FilezyNet.py
+++ b/module/plugins/hoster/FilezyNet.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -8,8 +9,12 @@ class FilezyNet(XFileSharingPro):
__name__ = "FilezyNet"
__type__ = "hoster"
__version__ = "0.1"
+
__pattern__ = r'http://(?:www\.)?filezy.net/.*/.*.html'
+
__description__ = """Filezy.net hoster plugin"""
+ __author_name__ = None
+ __author_mail__ = None
HOSTER_NAME = "filezy.net"
@@ -17,6 +22,7 @@ class FilezyNet(XFileSharingPro):
WAIT_PATTERN = r'<div id="countdown_str" class="seconds">\n<!--Wait--> <span id=".*?">(\d+)</span>'
DOWNLOAD_JS_PATTERN = r"<script type='text/javascript'>eval(.*)"
+
def setup(self):
self.resumeDownload = True
self.multiDL = self.premium
@@ -29,7 +35,7 @@ class FilezyNet(XFileSharingPro):
obfuscated_js = re.search(self.DOWNLOAD_JS_PATTERN, self.html)
dl_file_now = self.js.eval(obfuscated_js.group(1))
- link = re.search(self.DIRECT_LINK_PATTERN, dl_file_now)
+ link = re.search(self.LINK_PATTERN, dl_file_now)
return link.group(1)
diff --git a/module/plugins/hoster/FiredriveCom.py b/module/plugins/hoster/FiredriveCom.py
new file mode 100644
index 000000000..47c6a4214
--- /dev/null
+++ b/module/plugins/hoster/FiredriveCom.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class FiredriveCom(SimpleHoster):
+ __name__ = "FiredriveCom"
+ __type__ = "hoster"
+ __version__ = "0.03"
+
+ __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
+
+ __description__ = """Firedrive.com hoster plugin"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
+
+ FILE_NAME_PATTERN = r'<b>Name:</b> (?P<N>.+) <br>'
+ FILE_SIZE_PATTERN = r'<b>Size:</b> (?P<S>[\d.]+) (?P<U>[a-zA-Z]+) <br>'
+ OFFLINE_PATTERN = r'class="sad_face_image"|>No such page here.<'
+ TEMP_OFFLINE_PATTERN = r'>(File Temporarily Unavailable|Server Error. Try again later)'
+
+ FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.firedrive.com/file/\g<ID>')]
+
+ LINK_PATTERN = r'<a href="(https?://dl\.firedrive\.com/\?key=.+?)"'
+
+
+ def setup(self):
+ self.multiDL = self.resumeDownload = True
+ self.chunkLimit = -1
+
+ def handleFree(self):
+ link = self._getLink()
+ self.logDebug("Direct link: " + link)
+ self.download(link, disposition=True)
+
+ def _getLink(self):
+ f = re.search(self.LINK_PATTERN, self.html)
+ if f:
+ return f.group(1)
+ else:
+ self.html = self.load(self.pyfile.url, post={"confirm": re.search(r'name="confirm" value="(.+?)"', self.html).group(1)})
+ f = re.search(self.LINK_PATTERN, self.html)
+ if f:
+ return f.group(1)
+ else:
+ self.parseError("Direct download link not found")
+
+
+getInfo = create_getInfo(FiredriveCom)
diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py
index 3e0466a41..2bf9e0caf 100644
--- a/module/plugins/hoster/FlyFilesNet.py
+++ b/module/plugins/hoster/FlyFilesNet.py
@@ -1,24 +1,31 @@
# -*- coding: utf-8 -*-
import re
-import urllib
-from module.plugins.internal.SimpleHoster import SimpleHoster
+from urllib import unquote
+
from module.network.RequestFactory import getURL
+from module.plugins.internal.SimpleHoster import SimpleHoster
class FlyFilesNet(SimpleHoster):
__name__ = "FlyFilesNet"
- __version__ = "0.1"
__type__ = "hoster"
+ __version__ = "0.1"
+
__pattern__ = r'http://(?:www\.)?flyfiles\.net/.*'
+ __description__ = """FlyFiles.net hoster plugin"""
+ __author_name__ = None
+ __author_mail__ = None
+
SESSION_PATTERN = r'flyfiles\.net/(.*)/.*'
FILE_NAME_PATTERN = r'flyfiles\.net/.*/(.*)'
+
def process(self, pyfile):
- pyfile.name = re.search(self.FILE_NAME_PATTERN, pyfile.url).group(1)
- pyfile.name = urllib.unquote_plus(pyfile.name)
+ name = re.search(self.FILE_NAME_PATTERN, pyfile.url).group(1)
+ pyfile.name = unquote_plus(name)
session = re.search(self.SESSION_PATTERN, pyfile.url).group(1)
diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py
index 9c7752fe1..2668a22d3 100644
--- a/module/plugins/hoster/FourSharedCom.py
+++ b/module/plugins/hoster/FourSharedCom.py
@@ -8,42 +8,46 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FourSharedCom(SimpleHoster):
__name__ = "FourSharedCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?4shared(\-china)?\.com/(account/)?(download|get|file|document|photo|video|audio|mp3|office|rar|zip|archive|music)/.+?/.*'
__version__ = "0.29"
+
+ __pattern__ = r'https?://(?:www\.)?4shared(\-china)?\.com/(account/)?(download|get|file|document|photo|video|audio|mp3|office|rar|zip|archive|music)/.+?/.*'
+
__description__ = """4Shared.com hoster plugin"""
__author_name__ = ("jeix", "zoidberg")
__author_mail__ = ("jeix@hasnomail.de", "zoidberg@mujmail.cz")
FILE_NAME_PATTERN = r'<meta name="title" content="(?P<N>.+?)"'
- FILE_SIZE_PATTERN = '<span title="Size: (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B">'
- FILE_OFFLINE_PATTERN = 'The file link that you requested is not valid\.|This file was deleted.'
+ FILE_SIZE_PATTERN = r'<span title="Size: (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B">'
+ OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted.'
+
FILE_NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))]
FILE_SIZE_REPLACEMENTS = [(",", "")]
- DOWNLOAD_BUTTON_PATTERN = 'id="btnLink" href="(.*?)"'
- FID_PATTERN = 'name="d3fid" value="(.*?)"'
DOWNLOAD_URL_PATTERN = r'name="d3link" value="(.*?)"'
+ DOWNLOAD_BUTTON_PATTERN = r'id="btnLink" href="(.*?)"'
+ FID_PATTERN = r'name="d3fid" value="(.*?)"'
+
def handleFree(self):
if not self.account:
self.fail("User not logged in")
- found = re.search(self.DOWNLOAD_BUTTON_PATTERN, self.html)
- if found:
- link = found.group(1)
+ m = re.search(self.DOWNLOAD_BUTTON_PATTERN, self.html)
+ if m:
+ link = m.group(1)
else:
link = re.sub(r'/(download|get|file|document|photo|video|audio)/', r'/get/', self.pyfile.url)
self.html = self.load(link)
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if not found:
+ m = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
+ if m is None:
self.parseError('Download link')
- link = found.group(1)
+ link = m.group(1)
try:
- found = re.search(self.FID_PATTERN, self.html)
- response = self.load('http://www.4shared.com/web/d2/getFreeDownloadLimitInfo?fileId=%s' % found.group(1))
+ m = re.search(self.FID_PATTERN, self.html)
+ response = self.load('http://www.4shared.com/web/d2/getFreeDownloadLimitInfo?fileId=%s' % m.group(1))
self.logDebug(response)
except:
pass
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py
index ad9abeb96..1b042bde3 100644
--- a/module/plugins/hoster/FreakshareCom.py
+++ b/module/plugins/hoster/FreakshareCom.py
@@ -1,19 +1,24 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
class FreakshareCom(Hoster):
__name__ = "FreakshareCom"
__type__ = "hoster"
+ __version__ = "0.39"
+
__pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/'
- __version__ = "0.38"
+
__description__ = """Freakshare.com hoster plugin"""
__author_name__ = ("sitacuisses", "spoob", "mkaay", "Toilal")
__author_mail__ = ("sitacuisses@yahoo.de", "spoob@pyload.org", "mkaay@mkaay.de", "toilal.dev@gmail.com")
+
def setup(self):
self.multiDL = False
self.req_opts = []
@@ -80,7 +85,7 @@ class FreakshareCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if not self.wantReconnect:
self.req_opts = self.get_download_options() # get the Post options for the Request
@@ -90,7 +95,7 @@ class FreakshareCom(Hoster):
self.offline()
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
if not self.wantReconnect:
file_name = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">([^ ]+)", self.html)
@@ -104,7 +109,7 @@ class FreakshareCom(Hoster):
def get_file_size(self):
size = 0
- if self.html is None:
+ if not self.html:
self.download_html()
if not self.wantReconnect:
file_size_check = re.search(
@@ -117,12 +122,12 @@ class FreakshareCom(Hoster):
return size
def get_waiting_time(self):
- if self.html is None:
+ if not self.html:
self.download_html()
if "Your Traffic is used up for today" in self.html:
self.wantReconnect = True
- return 24 * 60 * 60
+ return secondsToMidnight(gmt=2)
timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html)
if timestring:
@@ -133,7 +138,7 @@ class FreakshareCom(Hoster):
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r"This file does not exist!", self.html) is not None:
return False
@@ -162,7 +167,7 @@ class FreakshareCom(Hoster):
if challenge:
re_captcha = ReCaptcha(self)
- (request_options["recaptcha_challenge_field"],
- request_options["recaptcha_response_field"]) = re_captcha.challenge(challenge.group(1))
+ (request_options['recaptcha_challenge_field'],
+ request_options['recaptcha_response_field']) = re_captcha.challenge(challenge.group(1))
return request_options
diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py
index d72b12a12..dc9188f05 100644
--- a/module/plugins/hoster/FreeWayMe.py
+++ b/module/plugins/hoster/FreeWayMe.py
@@ -1,34 +1,20 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: Nicolas Giese
-"""
-
from module.plugins.Hoster import Hoster
class FreeWayMe(Hoster):
__name__ = "FreeWayMe"
- __version__ = "0.11"
__type__ = "hoster"
+ __version__ = "0.11"
+
__pattern__ = r'https://(?:www\.)?free-way.me/.*'
+
__description__ = """FreeWayMe hoster plugin"""
__author_name__ = "Nicolas Giese"
__author_mail__ = "james@free-way.me"
+
def setup(self):
self.resumeDownload = False
self.chunkLimit = 1
diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py
index eebb43b48..d6549a8df 100644
--- a/module/plugins/hoster/FreevideoCz.py
+++ b/module/plugins/hoster/FreevideoCz.py
@@ -1,68 +1,18 @@
# -*- coding: utf-8 -*-
-"""
- 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.
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
- 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/>.
-
- @author: zoidberg
-"""
-
-import re
-from module.plugins.Hoster import Hoster
-from module.network.RequestFactory import getURL
-
-
-def getInfo(urls):
- result = []
-
- for url in urls:
-
- html = getURL(url)
- if re.search(FreevideoCz.FILE_OFFLINE_PATTERN, html):
- # File offline
- result.append((url, 0, 1, url))
- else:
- result.append((url, 0, 2, url))
- yield result
-
-
-class FreevideoCz(Hoster):
+class FreevideoCz(DeadHoster):
__name__ = "FreevideoCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?freevideo.cz/vase-videa/(.*)\.html'
- __version__ = "0.2"
+ __version__ = "0.3"
+
+ __pattern__ = r'http://(?:www\.)?freevideo\.cz/vase-videa/.+'
+
__description__ = """Freevideo.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- URL_PATTERN = r'clip: {\s*url: "([^"]+)"'
- FILE_OFFLINE_PATTERN = r'<h2 class="red-corner-full">Str.nka nebyla nalezena</h2>'
-
- def setup(self):
- self.multiDL = self.resumeDownload = True
-
- def process(self, pyfile):
-
- self.html = self.load(pyfile.url, decode=True)
-
- if re.search(self.FILE_OFFLINE_PATTERN, self.html):
- self.offline()
-
- found = re.search(self.URL_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (URL)")
- download_url = found.group(1)
-
- pyfile.name = re.match(self.__pattern__, pyfile.url).group(1) + ".mp4"
- self.download(download_url)
+getInfo = create_getInfo(FreevideoCz) \ No newline at end of file
diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py
index f9a9b6c16..bc042cbcc 100644
--- a/module/plugins/hoster/FshareVn.py
+++ b/module/plugins/hoster/FshareVn.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
import re
+
from time import strptime, mktime, gmtime
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
from module.network.RequestFactory import getURL
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
def getInfo(urls):
@@ -26,19 +27,23 @@ def doubleDecode(m):
class FshareVn(SimpleHoster):
__name__ = "FshareVn"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*'
__version__ = "0.16"
+
+ __pattern__ = r'http://(?:www\.)?fshare.vn/file/.*'
+
__description__ = """FshareVn hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_INFO_PATTERN = r'<p>(?P<N>[^<]+)<\\/p>[\\trn\s]*<p>(?P<S>[0-9,.]+)\s*(?P<U>[kKMG])i?B<\\/p>'
- FILE_OFFLINE_PATTERN = r'<div class=\\"f_left file_w\\"|<\\/p>\\t\\t\\t\\t\\r\\n\\t\\t<p><\\/p>\\t\\t\\r\\n\\t\\t<p>0 KB<\\/p>'
+ OFFLINE_PATTERN = r'<div class=\\"f_left file_w\\"|<\\/p>\\t\\t\\t\\t\\r\\n\\t\\t<p><\\/p>\\t\\t\\r\\n\\t\\t<p>0 KB<\\/p>'
+
FILE_NAME_REPLACEMENTS = [("(.*)", doubleDecode)]
- DOWNLOAD_URL_PATTERN = r'action="(http://download.*?)[#"]'
- VIP_URL_PATTERN = r'<form action="([^>]+)" method="get" name="frm_download">'
+
+ LINK_PATTERN = r'action="(http://download.*?)[#"]'
WAIT_PATTERN = ur'Lượt tải xuống kế tiếp là:\s*(.*?)\s*<'
+
def process(self, pyfile):
self.html = self.load('http://www.fshare.vn/check_link.php', post={
"action": "check_link",
@@ -76,13 +81,13 @@ class FshareVn(SimpleHoster):
self.checkErrors()
- found = re.search(r'var count = (\d+)', self.html)
- self.setWait(int(found.group(1)) if found else 30)
+ m = re.search(r'var count = (\d+)', self.html)
+ self.setWait(int(m.group(1)) if m else 30)
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if not found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError('FREE DL URL')
- self.url = found.group(1)
+ self.url = m.group(1)
self.logDebug("FREE DL URL: %s" % self.url)
self.wait()
@@ -95,10 +100,10 @@ class FshareVn(SimpleHoster):
if '/error.php?' in self.req.lastEffectiveURL or u"Liên kết bạn chọn khÃŽng tồn" in self.html:
self.offline()
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- self.logInfo("Wait until %s ICT" % found.group(1))
- wait_until = mktime(strptime(found.group(1), "%d/%m/%Y %H:%M"))
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ self.logInfo("Wait until %s ICT" % m.group(1))
+ wait_until = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M"))
self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True)
self.retry()
elif '<ul class="message-error">' in self.html:
@@ -112,4 +117,4 @@ class FshareVn(SimpleHoster):
})
if check == "not_found":
- self.fail("File not found on server")
+ self.fail("File not m on server")
diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py
index af9191a4d..8de3f4f47 100644
--- a/module/plugins/hoster/Ftp.py
+++ b/module/plugins/hoster/Ftp.py
@@ -1,39 +1,24 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: jeix
- @author: mkaay
-"""
-from urlparse import urlparse
-from urllib import quote, unquote
import pycurl
import re
+from urllib import quote, unquote
+from urlparse import urlparse
+
from module.plugins.Hoster import Hoster
class Ftp(Hoster):
__name__ = "Ftp"
- __version__ = "0.41"
- __pattern__ = r'(ftps?|sftp)://(.*?:.*?@)?.*?/.*' # ftp://user:password@ftp.server.org/path/to/file
__type__ = "hoster"
+ __version__ = "0.41"
+
__description__ = """Download from ftp directory"""
__author_name__ = ("jeix", "mkaay", "zoidberg")
__author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
+
def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
@@ -53,7 +38,7 @@ class Ftp(Hoster):
if netloc in servers:
self.logDebug("Logging on to %s" % netloc)
- self.req.addAuth(self.account.accounts[netloc]["password"])
+ self.req.addAuth(self.account.accounts[netloc]['password'])
else:
for pwd in pyfile.package().password.splitlines():
if ":" in pwd:
@@ -70,21 +55,20 @@ class Ftp(Hoster):
self.req.http.c.setopt(pycurl.NOBODY, 0)
self.logDebug(self.req.http.header)
- found = re.search(r"Content-Length:\s*(\d+)", response)
- if found:
- pyfile.size = int(found.group(1))
+ m = re.search(r"Content-Length:\s*(\d+)", response)
+ if m:
+ pyfile.size = int(m.group(1))
self.download(pyfile.url)
else:
- #Naive ftp directory listing
+ #Naive ftp directory listing
if re.search(r'^25\d.*?"', self.req.http.header, re.M):
pyfile.url = pyfile.url.rstrip('/')
- pkgname = "/".join((pyfile.package().name, urlparse(pyfile.url).path.rpartition('/')[2]))
+ pkgname = "/".join(pyfile.package().name, urlparse(pyfile.url).path.rpartition('/')[2])
pyfile.url += '/'
self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY
response = self.load(pyfile.url, decode=False)
links = [pyfile.url + quote(x) for x in response.splitlines()]
self.logDebug("LINKS", links)
- self.core.api.addPackage(pkgname, links, 1)
- #self.core.files.addLinks(links, pyfile.package().id)
+ self.core.api.addPackage(pkgname, links)
else:
self.fail("Unexpected server response")
diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py
index 0cd54d2ea..66cef3013 100644
--- a/module/plugins/hoster/GamefrontCom.py
+++ b/module/plugins/hoster/GamefrontCom.py
@@ -1,23 +1,27 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Hoster import Hoster
+
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
from module.utils import parseFileSize
class GamefrontCom(Hoster):
__name__ = "GamefrontCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?gamefront.com/files/[A-Za-z0-9]+'
__version__ = "0.04"
+
+ __pattern__ = r'http://(?:www\.)?gamefront.com/files/[A-Za-z0-9]+'
+
__description__ = """Gamefront.com hoster plugin"""
__author_name__ = "fwannmacher"
__author_mail__ = "felipe@warhammerproject.com"
PATTERN_FILENAME = r'<title>(.*?) | Game Front'
PATTERN_FILESIZE = r'<dt>File Size:</dt>[\n\s]*<dd>(.*?)</dd>'
- PATTERN_OFFLINE = "This file doesn't exist, or has been removed."
+ PATTERN_OFFLINE = r"This file doesn't exist, or has been removed."
+
def setup(self):
self.resumeDownload = self.multiDL = True
@@ -32,12 +36,12 @@ class GamefrontCom(Hoster):
pyfile.name = self._getName()
- self.link = self._getLink()
+ link = self._getLink()
- if not self.link.startswith('http://'):
- self.link = "http://www.gamefront.com/" + self.link
+ if not link.startswith('http://'):
+ link = "http://www.gamefront.com/" + link
- self.download(self.link)
+ self.download(link)
def _checkOnline(self):
if re.search(self.PATTERN_OFFLINE, self.html):
@@ -55,9 +59,7 @@ class GamefrontCom(Hoster):
def _getLink(self):
self.html2 = self.load("http://www.gamefront.com/" + re.search("(files/service/thankyou\\?id=[A-Za-z0-9]+)",
self.html).group(1))
- self.link = re.search("<a href=\"(http://media[0-9]+\.gamefront.com/.*)\">click here</a>", self.html2)
-
- return self.link.group(1).replace("&amp;", "&")
+ return re.search("<a href=\"(http://media[0-9]+\.gamefront.com/.*)\">click here</a>", self.html2).group(1).replace("&amp;", "&")
def getInfo(urls):
@@ -70,15 +72,13 @@ def getInfo(urls):
result.append((url, 0, 1, url))
else:
name = re.search(GamefrontCom.PATTERN_FILENAME, html)
-
if name is None:
result.append((url, 0, 1, url))
- continue
-
- name = name.group(1)
- size = re.search(GamefrontCom.PATTERN_FILESIZE, html)
- size = parseFileSize(size.group(1))
+ else:
+ name = name.group(1)
+ size = re.search(GamefrontCom.PATTERN_FILESIZE, html)
+ size = parseFileSize(size.group(1))
- result.append((name, size, 3, url))
+ result.append((name, size, 3, url))
yield result
diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py
index 1282c996d..966ac8094 100644
--- a/module/plugins/hoster/GigapetaCom.py
+++ b/module/plugins/hoster/GigapetaCom.py
@@ -1,25 +1,9 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from random import randint
+
from pycurl import FOLLOWLOCATION
+from random import randint
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -27,16 +11,20 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class GigapetaCom(SimpleHoster):
__name__ = "GigapetaCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?gigapeta\.com/dl/\w+'
+
__description__ = """GigaPeta.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- SH_COOKIES = [("http://gigapeta.com", "lang", "us")]
FILE_NAME_PATTERN = r'<img src=".*" alt="file" />-->\s*(?P<N>.*?)\s*</td>'
FILE_SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>'
- FILE_OFFLINE_PATTERN = r'<div id="page_error">'
+ OFFLINE_PATTERN = r'<div id="page_error">'
+
+ SH_COOKIES = [(".gigapeta.com", "lang", "us")]
+
def handleFree(self):
captcha_key = str(randint(1, 100000000))
@@ -53,9 +41,9 @@ class GigapetaCom(SimpleHoster):
"captcha": captcha,
"download": "Download"})
- found = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I)
- if found:
- download_url = found.group(1)
+ m = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I)
+ if m:
+ download_url = m.group(1)
break
elif "Entered figures don&#96;t coincide with the picture" in self.html:
self.invalidCaptcha()
diff --git a/module/plugins/hoster/GooIm.py b/module/plugins/hoster/GooIm.py
index 1f77b7fe0..c43bd0fc9 100644
--- a/module/plugins/hoster/GooIm.py
+++ b/module/plugins/hoster/GooIm.py
@@ -1,18 +1,7 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
+#
+# Test links:
+# https://goo.im/devs/liquidsmooth/3.x/codina/Nightly/LS-KK-v3.2-2014-08-01-codina.zip
import re
@@ -22,32 +11,26 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class GooIm(SimpleHoster):
__name__ = "GooIm"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?goo\.im/.+'
- __version__ = "0.02"
+ __version__ = "0.03"
+
+ __pattern__ = r'https?://(?:www\.)?goo\.im/.+'
+
__description__ = """Goo.im hoster plugin"""
- __author_name__ = "stickell"
- __author_mail__ = "l.stickell@yahoo.it"
+ __author_name__ = "zapp-brannigan"
+ __author_mail__ = "fuerst.reinje@web.de"
+
+ FILE_NAME_PATTERN = r'You will be redirected to .*(?P<N>[^/ ]+) in'
+ OFFLINE_PATTERN = r'The file you requested was not found'
- FILE_NAME_PATTERN = r'<h3>Filename: (?P<N>.+)</h3>'
- FILE_OFFLINE_PATTERN = r'The file you requested was not found'
def setup(self):
- self.chunkLimit = -1
self.multiDL = self.resumeDownload = True
def handleFree(self):
- self.html = self.load(self.pyfile.url)
- m = re.search(r'MD5sum: (?P<MD5>[0-9a-z]{32})</h3>', self.html)
- if m:
- self.check_data = {"md5": m.group('MD5')}
+ url = self.pyfile.url
+ self.html = self.load(url, cookies=True)
self.wait(10)
-
- header = self.load(self.pyfile.url, just_header=True)
- if header['location']:
- self.logDebug("Direct link: " + header['location'])
- self.download(header['location'])
- else:
- self.parseError("Unable to detect direct download link")
+ self.download(url, cookies=True)
getInfo = create_getInfo(GooIm)
diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py
index 91e51e314..239d90f46 100644
--- a/module/plugins/hoster/HellshareCz.py
+++ b/module/plugins/hoster/HellshareCz.py
@@ -1,40 +1,27 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class HellshareCz(SimpleHoster):
__name__ = "HellshareCz"
__type__ = "hoster"
- __pattern__ = r'(http://(?:www\.)?hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*'
__version__ = "0.82"
+
+ __pattern__ = r'(http://(?:www\.)?hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*'
+
__description__ = """Hellshare.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>'
FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*)&nbsp;(?P<U>[kKMG])i?B</strong>'
- FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>'
+ OFFLINE_PATTERN = r'<h1>File not found.</h1>'
SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"'
+
def setup(self):
self.resumeDownload = self.multiDL = True if self.account else False
self.chunkLimit = 1
@@ -48,10 +35,10 @@ class HellshareCz(SimpleHoster):
if not self.checkTrafficLeft():
self.fail("Not enough traffic left for user %s." % self.user)
- found = re.search(self.SHOW_WINDOW_PATTERN, self.html)
- if not found:
+ m = re.search(self.SHOW_WINDOW_PATTERN, self.html)
+ if m is None:
self.parseError('SHOW WINDOW')
- self.url = "http://www.hellshare.com" + found.group(1)
+ self.url = "http://www.hellshare.com" + m.group(1)
self.logDebug("DOWNLOAD URL: " + self.url)
self.download(self.url)
diff --git a/module/plugins/hoster/HellspyCz.py b/module/plugins/hoster/HellspyCz.py
index e4ddce514..5800f28a0 100644
--- a/module/plugins/hoster/HellspyCz.py
+++ b/module/plugins/hoster/HellspyCz.py
@@ -1,30 +1,15 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class HellspyCz(DeadHoster):
__name__ = "HellspyCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(?:hellspy\.(?:cz|com|sk|hu|pl)|sciagaj.pl)(/\S+/\d+)/?.*'
__version__ = "0.28"
+
+ __pattern__ = r'http://(?:www\.)?(?:hellspy\.(?:cz|com|sk|hu|pl)|sciagaj.pl)(/\S+/\d+)/?.*'
+
__description__ = """HellSpy.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py
index 9a0947f2c..aac312a6b 100644
--- a/module/plugins/hoster/HotfileCom.py
+++ b/module/plugins/hoster/HotfileCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class HotfileCom(DeadHoster):
__name__ = "HotfileCom"
__type__ = "hoster"
- __pattern__ = r'https?://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/'
__version__ = "0.37"
+
+ __pattern__ = r'https?://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/'
+
__description__ = """Hotfile.com hoster plugin"""
__author_name__ = ("sitacuisses", "spoob", "mkaay", "JoKoT3")
__author_mail__ = ("sitacuisses@yhoo.de", "spoob@pyload.org", "mkaay@mkaay.de", "jokot3@gmail.com")
diff --git a/module/plugins/hoster/HugefilesNet.py b/module/plugins/hoster/HugefilesNet.py
index 2375c75f8..bf0a26c68 100644
--- a/module/plugins/hoster/HugefilesNet.py
+++ b/module/plugins/hoster/HugefilesNet.py
@@ -1,20 +1,6 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test links (random.bin):
+#
+# Test links:
# http://hugefiles.net/prthf9ya4w6s
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -23,8 +9,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class HugefilesNet(XFileSharingPro):
__name__ = "HugefilesNet"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?hugefiles\.net/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?hugefiles\.net/\w{12}'
+
__description__ = """Hugefiles.net hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/hoster/HundredEightyUploadCom.py b/module/plugins/hoster/HundredEightyUploadCom.py
index 6e5ffac30..e2e34ad00 100644
--- a/module/plugins/hoster/HundredEightyUploadCom.py
+++ b/module/plugins/hoster/HundredEightyUploadCom.py
@@ -1,20 +1,6 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test links (random.bin):
+#
+# Test links:
# http://180upload.com/js9qdm6kjnrs
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -23,8 +9,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class HundredEightyUploadCom(XFileSharingPro):
__name__ = "HundredEightyUploadCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?180upload\.com/(\w+).*'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?180upload\.com/(\w+).*'
+
__description__ = """180upload.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/hoster/IFileWs.py b/module/plugins/hoster/IFileWs.py
index 5b0adaa97..94d3e599e 100644
--- a/module/plugins/hoster/IFileWs.py
+++ b/module/plugins/hoster/IFileWs.py
@@ -6,17 +6,18 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class IFileWs(XFileSharingPro):
__name__ = "IFileWs"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?ifile\.ws/\w+(/.+)?'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?ifile\.ws/\w+(/.+)?'
+
__description__ = """Ifile.ws hoster plugin"""
__author_name__ = "z00nx"
__author_mail__ = "z00nx0@gmail.com"
HOSTER_NAME = "ifile.ws"
- FILE_INFO_PATTERN = '<h1\s+style="display:inline;">(?P<N>[^<]+)</h1>\s+\[(?P<S>[^]]+)\]'
- FILE_OFFLINE_PATTERN = 'File Not Found|The file was removed by administrator'
- LONG_WAIT_PATTERN = "(?P<M>\d(?=\s+minutes)).*(?P<S>\d+(?=\s+seconds))"
+ FILE_INFO_PATTERN = r'<h1\s+style="display:inline;">(?P<N>[^<]+)</h1>\s+\[(?P<S>[^]]+)\]'
+ OFFLINE_PATTERN = r'File Not Found|The file was removed by administrator'
getInfo = create_getInfo(IFileWs)
diff --git a/module/plugins/hoster/IcyFilesCom.py b/module/plugins/hoster/IcyFilesCom.py
index 82d760d01..a7c69009e 100644
--- a/module/plugins/hoster/IcyFilesCom.py
+++ b/module/plugins/hoster/IcyFilesCom.py
@@ -1,30 +1,15 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: godofdream
-"""
-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class IcyFilesCom(DeadHoster):
__name__ = "IcyFilesCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?icyfiles\.com/(.*)'
__version__ = "0.06"
+
+ __pattern__ = r'http://(?:www\.)?icyfiles\.com/(.*)'
+
__description__ = """IcyFiles.com hoster plugin"""
__author_name__ = "godofdream"
__author_mail__ = "soilfiction@gmail.com"
diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py
index 6c754624b..5dfd14d82 100644
--- a/module/plugins/hoster/IfileIt.py
+++ b/module/plugins/hoster/IfileIt.py
@@ -1,45 +1,30 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
from module.common.json_layer import json_loads
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class IfileIt(SimpleHoster):
__name__ = "IfileIt"
__type__ = "hoster"
- __pattern__ = r'^unmatchable$'
__version__ = "0.27"
+
+ __pattern__ = r'^unmatchable$'
+
__description__ = """Ifile.it"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- #EVAL_PATTERN = r'(eval\(function\(p,a,c,k,e,d\).*)'
- #DEC_PATTERN = r"requestBtn_clickEvent[^}]*url:\s*([^,]+)"
- DOWNLOAD_LINK_PATTERN = r'</span> If it doesn\'t, <a target="_blank" href="([^"]+)">'
+ LINK_PATTERN = r'</span> If it doesn\'t, <a target="_blank" href="([^"]+)">'
RECAPTCHA_KEY_PATTERN = r"var __recaptcha_public\s*=\s*'([^']+)';"
FILE_INFO_PATTERN = r'<span style="cursor: default;[^>]*>\s*(?P<N>.*?)\s*&nbsp;\s*<strong>\s*(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?B\s*</strong>\s*</span>'
- FILE_OFFLINE_PATTERN = r'<span style="cursor: default;[^>]*>\s*&nbsp;\s*<strong>\s*</strong>\s*</span>'
+ OFFLINE_PATTERN = r'<span style="cursor: default;[^>]*>\s*&nbsp;\s*<strong>\s*</strong>\s*</span>'
TEMP_OFFLINE_PATTERN = r'<span class="msg_red">Downloading of this file is temporarily disabled</span>'
+
def handleFree(self):
ukey = re.match(self.__pattern__, self.pyfile.url).group(1)
json_url = 'http://ifile.it/new_download-request.json'
@@ -50,17 +35,17 @@ class IfileIt(SimpleHoster):
if json_response['status'] == 3:
self.offline()
- if json_response["captcha"]:
+ if json_response['captcha']:
captcha_key = re.search(self.RECAPTCHA_KEY_PATTERN, self.html).group(1)
recaptcha = ReCaptcha(self)
- post_data["ctype"] = "recaptcha"
+ post_data['ctype'] = "recaptcha"
for _ in xrange(5):
- post_data["recaptcha_challenge"], post_data["recaptcha_response"] = recaptcha.challenge(captcha_key)
+ post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key)
json_response = json_loads(self.load(json_url, post=post_data))
self.logDebug(json_response)
- if json_response["retry"]:
+ if json_response['retry']:
self.invalidCaptcha()
else:
self.correctCaptcha()
@@ -71,7 +56,7 @@ class IfileIt(SimpleHoster):
if not "ticket_url" in json_response:
self.parseError("Download URL")
- self.download(json_response["ticket_url"])
+ self.download(json_response['ticket_url'])
getInfo = create_getInfo(IfileIt)
diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py
index 7c5fede72..efa8d8ab9 100644
--- a/module/plugins/hoster/IfolderRu.py
+++ b/module/plugins/hoster/IfolderRu.py
@@ -1,31 +1,17 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class IfolderRu(SimpleHoster):
__name__ = "IfolderRu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(?:ifolder\.ru|rusfolder\.(?:com|net|ru))/(?:files/)?(?P<ID>\d+).*'
__version__ = "0.38"
+
+ __pattern__ = r'http://(?:www\.)?(?:ifolder\.ru|rusfolder\.(?:com|net|ru))/(?:files/)?(?P<ID>\d+).*'
+
__description__ = """Ifolder.ru hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -33,14 +19,15 @@ class IfolderRu(SimpleHoster):
FILE_SIZE_REPLACEMENTS = [(u'Кб', 'KB'), (u'Мб', 'MB'), (u'Гб', 'GB')]
FILE_NAME_PATTERN = ur'(?:<div><span>)?НазваМОе:(?:</span>)? <b>(?P<N>[^<]+)</b><(?:/div|br)>'
FILE_SIZE_PATTERN = ur'(?:<div><span>)?РазЌер:(?:</span>)? <b>(?P<S>[^<]+)</b><(?:/div|br)>'
- FILE_OFFLINE_PATTERN = ur'<p>Ѐайл МПЌер <b>[^<]*</b> (Ме МайЎеМ|уЎалеМ) !!!</p>'
+ OFFLINE_PATTERN = ur'<p>Ѐайл МПЌер <b>[^<]*</b> (Ме МайЎеМ|уЎалеМ) !!!</p>'
SESSION_ID_PATTERN = r'<a href=(http://ints.(?:rusfolder.com|ifolder.ru)/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>'
INTS_SESSION_PATTERN = r'\(\'ints_session\'\);\s*if\(tag\)\{tag.value = "([^"]+)";\}'
HIDDEN_INPUT_PATTERN = r"var v = .*?name='([^']+)' value='1'"
- DOWNLOAD_LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"'
+ LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"'
WRONG_CAPTCHA_PATTERN = ur'<font color=Red>МеверМый кПЎ,<br>ввеЎОте еще раз</font><br>'
+
def setup(self):
self.resumeDownload = self.multiDL = True if self.account else False
self.chunkLimit = 1
@@ -79,7 +66,7 @@ class IfolderRu(SimpleHoster):
else:
self.fail("Invalid captcha")
- download_url = re.search(self.DOWNLOAD_LINK_PATTERN, self.html).group(1)
+ download_url = re.search(self.LINK_PATTERN, self.html).group(1)
self.correctCaptcha()
self.logDebug("Download URL: %s" % download_url)
self.download(download_url)
diff --git a/module/plugins/hoster/JumbofilesCom.py b/module/plugins/hoster/JumbofilesCom.py
index cdeffff34..2c9e4418b 100644
--- a/module/plugins/hoster/JumbofilesCom.py
+++ b/module/plugins/hoster/JumbofilesCom.py
@@ -1,21 +1,25 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class JumbofilesCom(SimpleHoster):
__name__ = "JumbofilesCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?jumbofiles.com/(\w{12}).*'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?jumbofiles.com/(\w{12}).*'
+
__description__ = """JumboFiles.com hoster plugin"""
__author_name__ = "godofdream"
__author_mail__ = "soilfiction@gmail.com"
- FILE_INFO_PATTERN = '<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>[KMG][bB])\)</small></TD></TR>'
- FILE_OFFLINE_PATTERN = 'Not Found or Deleted / Disabled due to inactivity or DMCA'
- DIRECT_LINK_PATTERN = '<meta http-equiv="refresh" content="10;url=(.+)">'
+ FILE_INFO_PATTERN = r'<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>[KMG][bB])\)</small></TD></TR>'
+ OFFLINE_PATTERN = r'Not Found or Deleted / Disabled due to inactivity or DMCA'
+ LINK_PATTERN = r'<meta http-equiv="refresh" content="10;url=(.+)">'
+
def setup(self):
self.resumeDownload = self.multiDL = True
@@ -24,7 +28,7 @@ class JumbofilesCom(SimpleHoster):
ukey = re.match(self.__pattern__, self.pyfile.url).group(1)
post_data = {"id": ukey, "op": "download3", "rand": ""}
html = self.load(self.pyfile.url, post=post_data, decode=True)
- url = re.search(self.DIRECT_LINK_PATTERN, html).group(1)
+ url = re.search(self.LINK_PATTERN, html).group(1)
self.logDebug("Download " + url)
self.download(url)
diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py
index a7f1efdb8..c1ec66435 100644
--- a/module/plugins/hoster/Keep2shareCC.py
+++ b/module/plugins/hoster/Keep2shareCC.py
@@ -1,47 +1,37 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test links (random.bin):
+#
+# Test links:
# http://k2s.cc/file/55fb73e1c00c5/random.bin
import re
+
from urlparse import urlparse, urljoin
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class Keep2shareCC(SimpleHoster):
__name__ = "Keep2shareCC"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P<ID>\w+)'
__version__ = "0.10"
+
+ __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P<ID>\w+)'
+
__description__ = """Keep2share.cc hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
FILE_NAME_PATTERN = r'File: <span>(?P<N>.+)</span>'
FILE_SIZE_PATTERN = r'Size: (?P<S>[^<]+)</div>'
- FILE_OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404'
+ OFFLINE_PATTERN = r'File not found or deleted|Sorry, this file is blocked or deleted|Error 404'
- DIRECT_LINK_PATTERN = r'To download this file with slow speed, use <a href="([^"]+)">this link</a>'
+ LINK_PATTERN = r'To download this file with slow speed, use <a href="([^"]+)">this link</a>'
WAIT_PATTERN = r'Please wait ([\d:]+) to download this file'
ALREADY_DOWNLOADING_PATTERN = r'Free account does not allow to download more than one file at the same time'
- RECAPTCHA_KEY = '6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb'
+ RECAPTCHA_KEY = "6LcYcN0SAAAAABtMlxKj7X0hRxOY8_2U86kI1vbb"
+
def handleFree(self):
self.sanitize_url()
@@ -76,8 +66,8 @@ class Keep2shareCC(SimpleHoster):
self.wait(30 * 60, reconnect=True)
self.retry()
- m = re.search(self.DIRECT_LINK_PATTERN, self.html)
- if not m:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError("Unable to detect direct link")
self.startDownload(m.group(1))
diff --git a/module/plugins/hoster/LemUploadsCom.py b/module/plugins/hoster/LemUploadsCom.py
index 426a757b3..b8a6062cb 100644
--- a/module/plugins/hoster/LemUploadsCom.py
+++ b/module/plugins/hoster/LemUploadsCom.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-
+#
# Test links:
# BigBuckBunny_320x180.mp4 - 61.7 Mb - http://lemuploads.com/uwol0aly9dld
@@ -9,15 +9,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class LemUploadsCom(XFileSharingPro):
__name__ = "LemUploadsCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?lemuploads.com/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?lemuploads.com/\w{12}'
+
__description__ = """LemUploads.com hoster plugin"""
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
HOSTER_NAME = "lemuploads.com"
- FILE_OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>'
+ OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>'
FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h2>(?P<N>[^<]+)</h2>'
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 58532fd28..3159be4f1 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -1,40 +1,25 @@
# -*- coding: utf-8 -*-
-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
+#
# API Documentation:
# http://api.letitbit.net/reg/static/api.pdf
-
-# Test links (random.bin):
+#
+# Test links:
# http://letitbit.net/download/07874.0b5709a7d3beee2408bb1f2eefce/random.bin.html
import re
-import urllib
-from module.plugins.internal.SimpleHoster import SimpleHoster
+from urllib import urlencode, urlopen
+
from module.common.json_layer import json_loads, json_dumps
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster
def api_download_info(url):
- json_data = ['yw7XQy2v9', ["download/info", {"link": url}]]
- post_data = urllib.urlencode({'r': json_dumps(json_data)})
- api_rep = urllib.urlopen('http://api.letitbit.net/json', data=post_data).read()
+ json_data = ["yw7XQy2v9", ["download/info", {"link": url}]]
+ post_data = urlencode({'r': json_dumps(json_data)})
+ api_rep = urlopen("http://api.letitbit.net/json", data=post_data).read()
return json_loads(api_rep)
@@ -51,20 +36,23 @@ def getInfo(urls):
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
+ __version__ = "0.24"
+
__pattern__ = r'http://(?:www\.)?(letitbit|shareflare).net/download/.*'
- __version__ = "0.23"
+
__description__ = """Letitbit.net hoster plugin"""
__author_name__ = ("zoidberg", "z00nx")
__author_mail__ = ("zoidberg@mujmail.cz", "z00nx0@gmail.com")
- CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'((http://[^/]+)[^']+)';"
- SECONDS_PATTERN = r"seconds\s*=\s*(\d+);"
- CAPTCHA_CONTROL_FIELD = r"recaptcha_control_field\s=\s'(?P<value>[^']+)'"
-
- DOMAIN = "http://letitbit.net"
FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")]
+
+ HOSTER_NAME = "letitbit.net"
+
+ SECONDS_PATTERN = r'seconds\s*=\s*(\d+);'
+ CAPTCHA_CONTROL_FIELD = r"recaptcha_control_field\s=\s'(?P<value>[^']+)'"
RECAPTCHA_KEY = "6Lc9zdMSAAAAAF-7s2wuQ-036pLRbM0p8dDaQdAM"
+
def setup(self):
self.resumeDownload = True
#TODO confirm that resume works
@@ -82,36 +70,39 @@ class LetitbitNet(SimpleHoster):
action, inputs = self.parseHtmlForm('id="ifree_form"')
if not action:
self.parseError("page 1 / ifree_form")
+
+ domain = "http://www." + self.HOSTER_NAME
self.pyfile.size = float(inputs['sssize'])
self.logDebug(action, inputs)
inputs['desc'] = ""
- self.html = self.load(self.DOMAIN + action, post=inputs, cookies=True)
+ self.html = self.load(domain + action, post=inputs, cookies=True)
# action, inputs = self.parseHtmlForm('id="d3_form"')
- # if not action: self.parseError("page 2 / d3_form")
- # #self.logDebug(action, inputs)
+ # if not action:
+ # self.parseError("page 2 / d3_form")
+ # self.logDebug(action, inputs)
#
# self.html = self.load(action, post = inputs, cookies = True)
#
# try:
# ajax_check_url, captcha_url = re.search(self.CHECK_URL_PATTERN, self.html).groups()
- # found = re.search(self.SECONDS_PATTERN, self.html)
- # seconds = int(found.group(1)) if found else 60
+ # m = re.search(self.SECONDS_PATTERN, self.html)
+ # seconds = int(m.group(1)) if m else 60
# self.wait(seconds+1)
# except Exception, e:
# self.logError(e)
# self.parseError("page 3 / js")
- found = re.search(self.SECONDS_PATTERN, self.html)
- seconds = int(found.group(1)) if found else 60
+ m = re.search(self.SECONDS_PATTERN, self.html)
+ seconds = int(m.group(1)) if m else 60
self.logDebug("Seconds found", seconds)
- found = re.search(self.CAPTCHA_CONTROL_FIELD, self.html)
- recaptcha_control_field = found.group(1)
+ m = re.search(self.CAPTCHA_CONTROL_FIELD, self.html)
+ recaptcha_control_field = m.group(1)
self.logDebug("ReCaptcha control field found", recaptcha_control_field)
self.wait(seconds + 1)
- response = self.load("%s/ajax/download3.php" % self.DOMAIN, post=" ", cookies=True)
+ response = self.load("%s/ajax/download3.php" % domain, post=" ", cookies=True)
if response != '1':
self.parseError('Unknown response - ajax_check_url')
self.logDebug(response)
@@ -121,15 +112,15 @@ class LetitbitNet(SimpleHoster):
post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response,
"recaptcha_control_field": recaptcha_control_field}
self.logDebug("Post data to send", post_data)
- response = self.load('%s/ajax/check_recaptcha.php' % self.DOMAIN, post=post_data, cookies=True)
+ response = self.load('%s/ajax/check_recaptcha.php' % domain, post=post_data, cookies=True)
self.logDebug(response)
if not response:
self.invalidCaptcha()
if response == "error_free_download_blocked":
- self.logInfo("Daily limit reached, waiting 24 hours")
- self.wait(24 * 60 * 60)
+ self.logWarning("Daily limit reached")
+ self.wait(secondsToMidnight(gmt=2), True)
if response == "error_wrong_captcha":
- self.logInfo("Wrong Captcha")
+ self.logError("Wrong Captcha")
self.invalidCaptcha()
self.retry()
elif response.startswith('['):
@@ -153,7 +144,7 @@ class LetitbitNet(SimpleHoster):
def handlePremium(self):
api_key = self.user
- premium_key = self.account.getAccountData(self.user)["password"]
+ premium_key = self.account.getAccountData(self.user)['password']
json_data = [api_key, ["download/direct_links", {"pass": premium_key, "link": self.pyfile.url}]]
api_rep = self.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)})
diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py
index 2ed7744d7..e4200e9f2 100644
--- a/module/plugins/hoster/LinksnappyCom.py
+++ b/module/plugins/hoster/LinksnappyCom.py
@@ -1,23 +1,27 @@
# -*- coding: utf-8 -*-
import re
+
from urlparse import urlsplit
-from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads, json_dumps
+from module.plugins.Hoster import Hoster
class LinksnappyCom(Hoster):
__name__ = "LinksnappyCom"
- __version__ = "0.02"
__type__ = "hoster"
+ __version__ = "0.02"
+
__pattern__ = r'https?://(?:[^/]*\.)?linksnappy\.com'
+
__description__ = """Linksnappy.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
SINGLE_CHUNK_HOSTERS = ('easybytez.com')
+
def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
@@ -34,7 +38,7 @@ class LinksnappyCom(Hoster):
json_params = json_dumps({'link': pyfile.url,
'type': host,
'username': self.user,
- 'password': self.account.getAccountData(self.user)["password"]})
+ 'password': self.account.getAccountData(self.user)['password']})
r = self.load('http://gen.linksnappy.com/genAPI.php',
post={'genLinks': json_params})
self.logDebug("JSON data: " + r)
diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py
index e52346274..18398e905 100644
--- a/module/plugins/hoster/LoadTo.py
+++ b/module/plugins/hoster/LoadTo.py
@@ -1,61 +1,48 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
-# Test links (random.bin):
+#
+# Test links:
# http://www.load.to/JWydcofUY6/random.bin
# http://www.load.to/oeSmrfkXE/random100.bin
import re
+from module.plugins.internal.CaptchaService import SolveMedia
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.plugins.internal.CaptchaService import ReCaptcha
class LoadTo(SimpleHoster):
__name__ = "LoadTo"
__type__ = "hoster"
+ __version__ = "0.16"
+
__pattern__ = r'http://(?:www\.)?load\.to/\w+'
- __version__ = "0.13"
- __description__ = """Load.to hoster plugin"""
+
+ __description__ = """ Load.to hoster plugin """
__author_name__ = ("halfman", "stickell")
__author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it")
- FILE_INFO_PATTERN = r'<a [^>]+>(?P<N>.+)</a></h3>\s*Size: (?P<S>\d+) (?P<U>[kKmMgG]?i?[bB])'
- URL_PATTERN = r'<form method="post" action="(.+?)"'
- FILE_OFFLINE_PATTERN = r'Can\'t find file. Please check URL.'
+ FILE_NAME_PATTERN = r'<h1>(?P<N>.+)</h1>'
+ FILE_SIZE_PATTERN = r'Size: (?P<S>[\d.]+) (?P<U>\w+)'
+ OFFLINE_PATTERN = r'>Can\'t find file'
+
+ LINK_PATTERN = r'<form method="post" action="(.+?)"'
WAIT_PATTERN = r'type="submit" value="Download \((\d+)\)"'
- RECAPTCHA_PATTERN = r'http://www.google.com/recaptcha/api/challenge'
- RECAPTCHA_KEY = "6Lc34eISAAAAAKNbPVyxBgNriTjPRmF-FA1oxApG"
+ SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)'
+
+ FILE_URL_REPLACEMENTS = [(r'(\w)$', r'\1/')]
+
def setup(self):
self.multiDL = True
self.chunkLimit = 1
- def process(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
- self.getFileInfo()
-
- # Check if File is online
- if re.search(self.FILE_OFFLINE_PATTERN, self.html):
- self.offline()
+ def handleFree(self):
# Search for Download URL
- m = re.search(self.URL_PATTERN, self.html)
- if not m:
- self.parseError('Unable to detect download URL')
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
+ self.parseError("Unable to detect download URL")
+
download_url = m.group(1)
# Set Timer - may be obsolete
@@ -63,23 +50,15 @@ class LoadTo(SimpleHoster):
if m:
self.wait(m.group(1))
- # Check if reCaptcha is present
- m = re.search(self.RECAPTCHA_PATTERN, self.html)
- if not m: # No captcha found
+ # Load.to is using solvemedia captchas since ~july 2014:
+ m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
+ if m is None:
self.download(download_url)
else:
- recaptcha = ReCaptcha(self)
- for _ in xrange(5):
- challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY)
- if not response == '0':
- break
- else:
- self.fail("No valid captcha solution received")
-
- self.download(download_url,
- post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response})
-
- # Verifiy reCaptcha by checking content of file for html 404-error
+ captcha_key = m.group(1)
+ solvemedia = SolveMedia(self)
+ captcha_challenge, captcha_response = solvemedia.challenge(captcha_key)
+ self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response})
check = self.checkDownload({"404": re.compile("\A<h1>404 Not Found</h1>")})
if check == "404":
self.logWarning("The captcha you entered was incorrect. Please try again.")
diff --git a/module/plugins/hoster/LomafileCom.py b/module/plugins/hoster/LomafileCom.py
new file mode 100644
index 000000000..372d42fd3
--- /dev/null
+++ b/module/plugins/hoster/LomafileCom.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class LomafileCom(SimpleHoster):
+ __name__ = "LomafileCom"
+ __type__ = "hoster"
+ __version__ = "0.2"
+
+ __pattern__ = r'https?://lomafile\.com/.+/[\w\.]+'
+
+ __description__ = """ Lomafile.com hoster plugin """
+ __author_name__ = "nath_schwarz"
+ __author_mail__ = "nathan.notwhite@gmail.com"
+
+ FILE_NAME_PATTERN = r'Filename:[^>]*>(?P<N>[\w\.]+)'
+ FILE_SIZE_PATTERN = r'\((?P<S>\d+)\s(?P<U>\w+)\)'
+ OFFLINE_PATTERN = r'Software error'
+
+
+ def handleFree(self):
+ for _ in range(3):
+ captcha_id = re.search(r'src="http://lomafile\.com/captchas/(?P<id>\w+)\.jpg"', self.html)
+ if not captcha_id:
+ self.parseError("Unable to parse captcha id.")
+ else:
+ captcha_id = captcha_id.group("id")
+
+ form_id = re.search(r'name="id" value="(?P<id>\w+)"', self.html)
+ if not form_id:
+ self.parseError("Unable to parse form id")
+ else:
+ form_id = form_id.group("id")
+
+ captcha = self.decryptCaptcha("http://lomafile.com/captchas/" + captcha_id + ".jpg")
+
+ self.wait(60)
+
+ self.html = self.load(self.pyfile.url, post={
+ "op": "download2",
+ "id": form_id,
+ "rand": captcha_id,
+ "code": captcha,
+ "down_direct": "1"})
+
+ download_url = re.search(r'http://[\d\.]+:\d+/d/\w+/[\w\.]+', self.html)
+ if download_url is None:
+ self.invalidCaptcha()
+ self.logDebug("Invalid captcha.")
+ else:
+ download_url = download_url.group(0)
+ self.logDebug("Download URL: %s" % download_url)
+ self.download(download_url)
+ else:
+ self.fail("Invalid captcha-code entered.")
+
+
+getInfo = create_getInfo(LomafileCom)
diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py
index 75520a6cf..60f1204e5 100644
--- a/module/plugins/hoster/LuckyShareNet.py
+++ b/module/plugins/hoster/LuckyShareNet.py
@@ -1,24 +1,28 @@
# -*- coding: utf-8 -*-
import re
+
from module.lib.bottle import json_loads
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class LuckyShareNet(SimpleHoster):
__name__ = "LuckyShareNet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?luckyshare.net/(?P<ID>\d{10,})'
__version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?luckyshare.net/(?P<ID>\d{10,})'
+
__description__ = """LuckyShare.net hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
FILE_INFO_PATTERN = r"<h1 class='file_name'>(?P<N>\S+)</h1>\s*<span class='file_size'>Filesize: (?P<S>[\d.]+)(?P<U>\w+)</span>"
- FILE_OFFLINE_PATTERN = 'There is no such file available'
- RECAPTCHA_KEY = '6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw'
+ OFFLINE_PATTERN = r'There is no such file available'
+ RECAPTCHA_KEY = "6LdivsgSAAAAANWh-d7rPE1mus4yVWuSQIJKIYNw"
+
def parseJson(self, rep):
if 'AJAX Error' in rep:
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index 52e38aada..d0878a34d 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -1,25 +1,9 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
+
from module.plugins.internal.CaptchaService import SolveMedia
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
from module.network.RequestFactory import getURL
@@ -63,13 +47,15 @@ def getInfo(urls):
class MediafireCom(SimpleHoster):
__name__ = "MediafireCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?mediafire\.com/(file/|(view/?|download.php)?\?)(\w{11}|\w{15})($|/)'
__version__ = "0.79"
+
+ __pattern__ = r'http://(?:www\.)?mediafire\.com/(file/|(view/?|download.php)?\?)(\w{11}|\w{15})($|/)'
+
__description__ = """Mediafire.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
- DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"'
+ LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"'
JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);"
JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);"
SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.noscript\?k=([^"]+)'
@@ -78,7 +64,8 @@ class MediafireCom(SimpleHoster):
FILE_NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>'
FILE_INFO_PATTERN = r"oFileSharePopup\.ald\('(?P<ID>[^']*)','(?P<N>[^']*)','(?P<S>[^']*)','','(?P<sha256>[^']*)'\)"
- FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>'
+ OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>'
+
def setup(self):
self.multiDL = False
@@ -115,19 +102,19 @@ class MediafireCom(SimpleHoster):
else:
self.fail("No or incorrect password")
- found = re.search(r'kNO = "(http://.*?)";', self.html)
- if not found:
+ m = re.search(r'kNO = r"(http://.*?)";', self.html)
+ if m is None:
self.parseError("Download URL")
- download_url = found.group(1)
+ download_url = m.group(1)
self.logDebug("DOWNLOAD LINK:", download_url)
self.download(download_url)
def checkCaptcha(self):
for _ in xrange(5):
- found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
solvemedia = SolveMedia(self)
captcha_challenge, captcha_response = solvemedia.challenge(captcha_key)
self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge,
diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py
index 46eb0eb11..13415d063 100644
--- a/module/plugins/hoster/MegaDebridEu.py
+++ b/module/plugins/hoster/MegaDebridEu.py
@@ -1,38 +1,27 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
+
from urllib import unquote_plus
-from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
class MegaDebridEu(Hoster):
__name__ = "MegaDebridEu"
- __version__ = "0.3"
__type__ = "hoster"
+ __version__ = "0.4"
+
__pattern__ = r'^https?://(?:w{3}\d+\.mega-debrid.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[^/]+/.+$'
+
__description__ = """mega-debrid.eu hoster plugin"""
__author_name__ = "D.Ducatel"
__author_mail__ = "dducatel@je-geek.fr"
- # Define the base URL of MegaDebrid api
API_URL = "https://www.mega-debrid.eu/api.php"
+
def getFilename(self, url):
try:
return unquote_plus(url.rsplit("/", 1)[1])
@@ -46,7 +35,7 @@ class MegaDebridEu(Hoster):
self.exitOnFail(_("Please enter your %s account or deactivate this plugin") % "Mega-debrid.eu")
else:
if not self.connectToApi():
- self.exitOnFail(_("Impossible to connect to %s") % "Mega-debrid.eu")
+ self.exitOnFail(_("Unable to connect to %s") % "Mega-debrid.eu")
self.logDebug("Old URL: %s" % pyfile.url)
new_url = self.debridLink(pyfile.url)
@@ -64,11 +53,11 @@ class MegaDebridEu(Hoster):
"""
user, data = self.account.selectAccount()
jsonResponse = self.load(self.API_URL,
- get={'action': 'connectUser', 'login': user, 'password': data["password"]})
+ get={'action': 'connectUser', 'login': user, 'password': data['password']})
response = json_loads(jsonResponse)
- if response["response_code"] == "ok":
- self.token = response["token"]
+ if response['response_code'] == "ok":
+ self.token = response['token']
return True
else:
return False
@@ -82,11 +71,11 @@ class MegaDebridEu(Hoster):
post={"link": linkToDebrid})
response = json_loads(jsonResponse)
- if response["response_code"] == "ok":
- debridedLink = response["debridLink"][1:-1]
+ if response['response_code'] == "ok":
+ debridedLink = response['debridLink'][1:-1]
return debridedLink
else:
- self.exitOnFail(_("Impossible to debrid %s") % linkToDebrid)
+ self.exitOnFail("Unable to debrid %s" % linkToDebrid)
def exitOnFail(self, msg):
"""
diff --git a/module/plugins/hoster/MegaFilesSe.py b/module/plugins/hoster/MegaFilesSe.py
index 43601bdb1..975708597 100644
--- a/module/plugins/hoster/MegaFilesSe.py
+++ b/module/plugins/hoster/MegaFilesSe.py
@@ -6,15 +6,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class MegaFilesSe(XFileSharingPro):
__name__ = "MegaFilesSe"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?megafiles\.se/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?megafiles\.se/\w{12}'
+
__description__ = """MegaFiles.se hoster plugin"""
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
HOSTER_NAME = "megafiles.se"
- FILE_OFFLINE_PATTERN = r'<b><font[^>]*>File Not Found</font></b><br><br>'
+ OFFLINE_PATTERN = r'<b><font[^>]*>File Not Found</font></b><br><br>'
FILE_NAME_PATTERN = r'<div[^>]+>\s*<b>(?P<N>[^<]+)</b>\s*</div>'
diff --git a/module/plugins/hoster/MegaNz.py b/module/plugins/hoster/MegaNz.py
index a55220bc2..5562aad06 100644
--- a/module/plugins/hoster/MegaNz.py
+++ b/module/plugins/hoster/MegaNz.py
@@ -1,33 +1,33 @@
# -*- coding: utf-8 -*-
-import re
import random
-from array import array
-from os import remove
-from base64 import standard_b64decode
+import re
from Crypto.Cipher import AES
from Crypto.Util import Counter
+from array import array
+from base64 import standard_b64decode
+from os import remove
from module.common.json_layer import json_loads, json_dumps
from module.plugins.Hoster import Hoster
-#def getInfo(urls):
-# pass
-
class MegaNz(Hoster):
__name__ = "MegaNz"
__type__ = "hoster"
- __pattern__ = r'https?://([a-z0-9]+\.)?mega\.co\.nz/#!([a-zA-Z0-9!_\-]+)'
__version__ = "0.14"
+
+ __pattern__ = r'https?://([a-z0-9]+\.)?mega\.co\.nz/#!([a-zA-Z0-9!_\-]+)'
+
__description__ = """Mega.co.nz hoster plugin"""
- __author_name__ = ("RaNaN", )
- __author_mail__ = ("ranan@pyload.org", )
+ __author_name__ = "RaNaN"
+ __author_mail__ = "ranan@pyload.org"
API_URL = "https://g.api.mega.co.nz/cs?id=%d"
FILE_SUFFIX = ".crypted"
+
def b64_decode(self, data):
data = data.replace("-", "+").replace("_", "/")
return standard_b64decode(data + '=' * (-len(data) % 4))
@@ -110,7 +110,7 @@ class MegaNz(Hoster):
dl = self.callApi(a="g", g=1, p=node, ssl=1)[0]
if "e" in dl:
- e = dl["e"]
+ e = dl['e']
# ETEMPUNAVAIL (-18): Resource temporarily not available, please try again later
if e == -18:
self.retry()
@@ -121,12 +121,12 @@ class MegaNz(Hoster):
# EACCESS (-11): Access violation (e.g., trying to write to a read-only share)
key = self.b64_decode(key)
- attr = self.decryptAttr(dl["at"], key)
+ attr = self.decryptAttr(dl['at'], key)
- pyfile.name = attr["n"] + self.FILE_SUFFIX
+ pyfile.name = attr['n'] + self.FILE_SUFFIX
- self.download(dl["g"])
+ self.download(dl['g'])
self.decryptFile(key)
# Everything is finished and final name can be set
- pyfile.name = attr["n"]
+ pyfile.name = attr['n']
diff --git a/module/plugins/hoster/MegacrypterCom.py b/module/plugins/hoster/MegacrypterCom.py
index ee6be39a2..7a86dbf70 100644
--- a/module/plugins/hoster/MegacrypterCom.py
+++ b/module/plugins/hoster/MegacrypterCom.py
@@ -9,15 +9,18 @@ from module.plugins.hoster.MegaNz import MegaNz
class MegacrypterCom(MegaNz):
__name__ = "MegacrypterCom"
__type__ = "hoster"
- __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)'
__version__ = "0.2"
+
+ __pattern__ = r'(https?://[a-z0-9]{0,10}\.?megacrypter\.com/[a-zA-Z0-9!_\-]+)'
+
__description__ = """Megacrypter.com decrypter plugin"""
- __author_name__ = ("GonzaloSR", )
- __author_mail__ = ("gonzalo@gonzalosr.com", )
+ __author_name__ = "GonzaloSR"
+ __author_mail__ = "gonzalo@gonzalosr.com"
API_URL = "http://megacrypter.com/api"
FILE_SUFFIX = ".crypted"
+
def callApi(self, **kwargs):
""" Dispatch a call to the api, see megacrypter.com/api_doc """
self.logDebug("JSON request: " + json_dumps(kwargs))
@@ -36,15 +39,15 @@ class MegacrypterCom(MegaNz):
dl = self.callApi(link=node, m="dl")
# TODO: map error codes, implement password protection
- # if info["pass"] == True:
- # crypted_file_key, md5_file_key = info["key"].split("#")
+ # if info['pass'] is True:
+ # crypted_file_key, md5_file_key = info['key'].split("#")
- key = self.b64_decode(info["key"])
+ key = self.b64_decode(info['key'])
- pyfile.name = info["name"] + self.FILE_SUFFIX
+ pyfile.name = info['name'] + self.FILE_SUFFIX
- self.download(dl["url"])
+ self.download(dl['url'])
self.decryptFile(key)
# Everything is finished and final name can be set
- pyfile.name = info["name"]
+ pyfile.name = info['name']
diff --git a/module/plugins/hoster/MegareleaseOrg.py b/module/plugins/hoster/MegareleaseOrg.py
index cb8c7aa01..05b05c3b5 100644
--- a/module/plugins/hoster/MegareleaseOrg.py
+++ b/module/plugins/hoster/MegareleaseOrg.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -20,8 +6,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class MegareleaseOrg(XFileSharingPro):
__name__ = "MegareleaseOrg"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?megarelease.org/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?megarelease.org/\w{12}'
+
__description__ = """Megarelease.org hoster plugin"""
__author_name__ = ("derek3x", "stickell")
__author_mail__ = ("derek3x@vmail.me", "l.stickell@yahoo.it")
@@ -30,4 +18,5 @@ class MegareleaseOrg(XFileSharingPro):
FILE_INFO_PATTERN = r'<font color="red">%s/(?P<N>.+)</font> \((?P<S>[^)]+)\)</font>' % __pattern__
+
getInfo = create_getInfo(MegareleaseOrg)
diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py
index b73b4943c..c12897ed0 100644
--- a/module/plugins/hoster/MegasharesCom.py
+++ b/module/plugins/hoster/MegasharesCom.py
@@ -1,46 +1,35 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from time import time
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MegasharesCom(SimpleHoster):
__name__ = "MegasharesCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?megashares.com/.*'
__version__ = "0.24"
+
+ __pattern__ = r'http://(?:www\.)?megashares.com/.*'
+
__description__ = """Megashares.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- FILE_NAME_PATTERN = '<h1 class="black xxl"[^>]*title="(?P<N>[^"]+)">'
- FILE_SIZE_PATTERN = '<strong><span class="black">Filesize:</span></strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B<br />'
- DOWNLOAD_URL_PATTERN = r'<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">'
+ FILE_NAME_PATTERN = r'<h1 class="black xxl"[^>]*title="(?P<N>[^"]+)">'
+ FILE_SIZE_PATTERN = r'<strong><span class="black">Filesize:</span></strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B<br />'
+ OFFLINE_PATTERN = r'<dd class="red">(Invalid Link Request|Link has been deleted)'
+
+ LINK_PATTERN = r'<div id="show_download_button_%d"[^>]*>\s*<a href="([^"]+)">'
PASSPORT_LEFT_PATTERN = r'Your Download Passport is: <[^>]*>(\w+).*\s*You have\s*<[^>]*>\s*([0-9.]+) ([kKMG]i?B)'
PASSPORT_RENEW_PATTERN = r'Your download passport will renew in\s*<strong>(\d+)</strong>:<strong>(\d+)</strong>:<strong>(\d+)</strong>'
REACTIVATE_NUM_PATTERN = r'<input[^>]*id="random_num" value="(\d+)" />'
REACTIVATE_PASSPORT_PATTERN = r'<input[^>]*id="passport_num" value="(\w+)" />'
REQUEST_URI_PATTERN = r'var request_uri = "([^"]+)";'
NO_SLOTS_PATTERN = r'<dd class="red">All download slots for this link are currently filled'
- FILE_OFFLINE_PATTERN = r'<dd class="red">(Invalid Link Request|Link has been deleted)'
+
def setup(self):
self.resumeDownload = True
@@ -56,12 +45,13 @@ class MegasharesCom(SimpleHoster):
self.retry(wait_time=5 * 60)
self.getFileInfo()
- #if self.pyfile.size > 576716800: self.fail("This file is too large for free download")
+ # if self.pyfile.size > 576716800:
+ # self.fail("This file is too large for free download")
# Reactivate passport if needed
- found = re.search(self.REACTIVATE_PASSPORT_PATTERN, self.html)
- if found:
- passport_num = found.group(1)
+ m = re.search(self.REACTIVATE_PASSPORT_PATTERN, self.html)
+ if m:
+ passport_num = m.group(1)
request_uri = re.search(self.REQUEST_URI_PATTERN, self.html).group(1)
for _ in xrange(5):
@@ -86,28 +76,28 @@ class MegasharesCom(SimpleHoster):
self.fail("Failed to reactivate passport")
# Check traffic left on passport
- found = re.search(self.PASSPORT_LEFT_PATTERN, self.html)
- if not found:
+ m = re.search(self.PASSPORT_LEFT_PATTERN, self.html)
+ if m is None:
self.fail('Passport not found')
- self.logInfo("Download passport: %s" % found.group(1))
- data_left = float(found.group(2)) * 1024 ** {'KB': 1, 'MB': 2, 'GB': 3}[found.group(3)]
- self.logInfo("Data left: %s %s (%d MB needed)" % (found.group(2), found.group(3), self.pyfile.size / 1048576))
+ self.logInfo("Download passport: %s" % m.group(1))
+ data_left = float(m.group(2)) * 1024 ** {'KB': 1, 'MB': 2, 'GB': 3}[m.group(3)]
+ self.logInfo("Data left: %s %s (%d MB needed)" % (m.group(2), m.group(3), self.pyfile.size / 1048576))
if not data_left:
- found = re.search(self.PASSPORT_RENEW_PATTERN, self.html)
- renew = found.group(1) + found.group(2) + found.group(3) * 60 * 60 if found else 10 * 60
+ m = re.search(self.PASSPORT_RENEW_PATTERN, self.html)
+ renew = m.group(1) + m.group(2) + m.group(3) * 60 * 60 if m else 10 * 60
self.retry(max_tries=15, wait_time=renew, reason="Unable to get passport")
self.handleDownload(False)
def handleDownload(self, premium=False):
# Find download link;
- found = re.search(self.DOWNLOAD_URL_PATTERN % (1 if premium else 2), self.html)
+ m = re.search(self.LINK_PATTERN % (1 if premium else 2), self.html)
msg = '%s download URL' % ('Premium' if premium else 'Free')
- if not found:
+ if m is None:
self.parseError(msg)
- download_url = found.group(1)
+ download_url = m.group(1)
self.logDebug("%s: %s" % (msg, download_url))
self.download(download_url)
diff --git a/module/plugins/hoster/MovReelCom.py b/module/plugins/hoster/MovReelCom.py
index 2dedcf13d..6b13422b0 100644
--- a/module/plugins/hoster/MovReelCom.py
+++ b/module/plugins/hoster/MovReelCom.py
@@ -1,27 +1,24 @@
# -*- coding: utf-8 -*-
-#import re
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
-#from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
class MovReelCom(XFileSharingPro):
__name__ = "MovReelCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?movreel.com/.*'
__version__ = "1.20"
+
+ __pattern__ = r'http://(?:www\.)?movreel.com/.*'
+
__description__ = """MovReel.com hoster plugin"""
__author_name__ = "JorisV83"
__author_mail__ = "jorisv83-pyload@yahoo.com"
HOSTER_NAME = "movreel.com"
- #FILE_NAME_PATTERN = r'<b>Filename:</b>(?P<N>.*?)<br>'
- #FILE_SIZE_PATTERN = r'<b>Size:</b>(?P<S>.*?)<br>'
FILE_INFO_PATTERN = r'<h3>(?P<N>.+?) <small><sup>(?P<S>[\d.]+) (?P<U>..)</sup> </small></h3>'
- FILE_OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>'
- DIRECT_LINK_PATTERN = r'<a href="(http://[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/.*)">Download Link</a>'
- #OVR_DOWNLOAD_LINK_PATTERN = "var file_link = '(.*)';"
+ OFFLINE_PATTERN = r'<b>File Not Found</b><br><br>'
+ LINK_PATTERN = r'<a href="(http://[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/.*)">Download Link</a>'
getInfo = create_getInfo(MovReelCom)
diff --git a/module/plugins/hoster/MultiDebridCom.py b/module/plugins/hoster/MultiDebridCom.py
index 71f3df908..f70fa0f0e 100644
--- a/module/plugins/hoster/MultiDebridCom.py
+++ b/module/plugins/hoster/MultiDebridCom.py
@@ -1,34 +1,23 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
-from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
class MultiDebridCom(Hoster):
__name__ = "MultiDebridCom"
- __version__ = "0.03"
__type__ = "hoster"
+ __version__ = "0.03"
+
__pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'
+
__description__ = """Multi-debrid.com hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py
index e38bd048f..fdf5fbd70 100644
--- a/module/plugins/hoster/MultishareCz.py
+++ b/module/plugins/hoster/MultishareCz.py
@@ -1,40 +1,28 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from random import random
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MultishareCz(SimpleHoster):
__name__ = "MultishareCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?multishare.cz/stahnout/(?P<ID>\d+).*'
__version__ = "0.34"
+
+ __pattern__ = r'http://(?:www\.)?multishare.cz/stahnout/(?P<ID>\d+).*'
+
__description__ = """MultiShare.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_INFO_PATTERN = ur'(?:<li>Název|Soubor): <strong>(?P<N>[^<]+)</strong><(?:/li><li|br)>Velikost: <strong>(?P<S>[^<]+)</strong>'
- FILE_OFFLINE_PATTERN = ur'<h1>Stáhnout soubor</h1><p><strong>PoşadovanÜ soubor neexistuje.</strong></p>'
+ OFFLINE_PATTERN = ur'<h1>Stáhnout soubor</h1><p><strong>PoşadovanÜ soubor neexistuje.</strong></p>'
FILE_SIZE_REPLACEMENTS = [('&nbsp;', '')]
+
def process(self, pyfile):
msurl = re.match(self.__pattern__, pyfile.url)
if msurl:
@@ -70,15 +58,15 @@ class MultishareCz(SimpleHoster):
self.fail("Not enough credit left to download file")
url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random() * 10000 * random())
- params = {"u_ID": self.acc_info["u_ID"], "u_hash": self.acc_info["u_hash"], "link": self.pyfile.url}
+ params = {"u_ID": self.acc_info['u_ID'], "u_hash": self.acc_info['u_hash'], "link": self.pyfile.url}
self.logDebug(url, params)
self.download(url, get=params)
def checkCredit(self):
self.acc_info = self.account.getAccountInfo(self.user, True)
- self.logInfo("User %s has %i MB left" % (self.user, self.acc_info["trafficleft"] / 1024))
+ self.logInfo("User %s has %i MB left" % (self.user, self.acc_info['trafficleft'] / 1024))
- return self.pyfile.size / 1024 <= self.acc_info["trafficleft"]
+ return self.pyfile.size / 1024 <= self.acc_info['trafficleft']
getInfo = create_getInfo(MultishareCz)
diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py
index 21d95d092..630c97ec0 100644
--- a/module/plugins/hoster/MyvideoDe.py
+++ b/module/plugins/hoster/MyvideoDe.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
from module.unescape import unescape
@@ -8,12 +9,15 @@ from module.unescape import unescape
class MyvideoDe(Hoster):
__name__ = "MyvideoDe"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?myvideo.de/watch/'
__version__ = "0.9"
+
+ __pattern__ = r'http://(?:www\.)?myvideo.de/watch/'
+
__description__ = """Myvideo.de hoster plugin"""
__author_name__ = "spoob"
__author_mail__ = "spoob@pyload.org"
+
def process(self, pyfile):
self.pyfile = pyfile
self.download_html()
diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py
index 6f08e6207..18bed0231 100644
--- a/module/plugins/hoster/NarodRu.py
+++ b/module/plugins/hoster/NarodRu.py
@@ -1,61 +1,49 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from random import random
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class NarodRu(SimpleHoster):
__name__ = "NarodRu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?narod(\.yandex)?\.ru/(disk|start/[0-9]+\.\w+-narod\.yandex\.ru)/(?P<ID>\d+)/.+'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?narod(\.yandex)?\.ru/(disk|start/[0-9]+\.\w+-narod\.yandex\.ru)/(?P<ID>\d+)/.+'
+
__description__ = """Narod.ru hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<dt class="name">(?:<[^<]*>)*(?P<N>[^<]+)</dt>'
FILE_SIZE_PATTERN = r'<dd class="size">(?P<S>\d[^<]*)</dd>'
- FILE_OFFLINE_PATTERN = r'<title>404</title>|Ѐайл уЎалеМ с сервОса|ЗакПМчОлся срПк храМеМОя файла\.'
+ OFFLINE_PATTERN = r'<title>404</title>|Ѐайл уЎалеМ с сервОса|ЗакПМчОлся срПк храМеМОя файла\.'
FILE_SIZE_REPLACEMENTS = [(u'КБ', 'KB'), (u'МБ', 'MB'), (u'ГБ', 'GB')]
FILE_URL_REPLACEMENTS = [("narod.yandex.ru/", "narod.ru/"),
(r"/start/[0-9]+\.\w+-narod\.yandex\.ru/([0-9]{6,15})/\w+/(\w+)", r"/disk/\1/\2")]
CAPTCHA_PATTERN = r'<number url="(.*?)">(\w+)</number>'
- DOWNLOAD_LINK_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">'
+ LINK_PATTERN = r'<a class="h-link" rel="yandex_bar" href="(.+?)">'
+
def handleFree(self):
for _ in xrange(5):
self.html = self.load('http://narod.ru/disk/getcapchaxml/?rnd=%d' % int(random() * 777))
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if not found:
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m is None:
self.parseError('Captcha')
post_data = {"action": "sendcapcha"}
- captcha_url, post_data['key'] = found.groups()
+ captcha_url, post_data['key'] = m.groups()
post_data['rep'] = self.decryptCaptcha(captcha_url)
self.html = self.load(self.pyfile.url, post=post_data, decode=True)
- found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if found:
- url = 'http://narod.ru' + found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m:
+ url = 'http://narod.ru' + m.group(1)
self.correctCaptcha()
break
elif u'<b class="error-msg"><strong>ОшОблОсь?</strong>' in self.html:
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 4b8842d18..a45aafa63 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
import re
+
from time import sleep, time
-from module.plugins.Hoster import Hoster
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
@@ -51,12 +52,15 @@ def getInfo(urls):
class NetloadIn(Hoster):
__name__ = "NetloadIn"
__type__ = "hoster"
- __pattern__ = r'https?://(?:[^/]*\.)?netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)'
__version__ = "0.45"
+
+ __pattern__ = r'https?://(?:[^/]*\.)?netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)'
+
__description__ = """Netload.in hoster plugin"""
__author_name__ = ("spoob", "RaNaN", "Gregy")
__author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz")
+
def setup(self):
self.multiDL = self.resumeDownload = self.premium
@@ -69,8 +73,8 @@ class NetloadIn(Hoster):
def prepare(self):
self.download_api_data()
- if self.api_data and self.api_data["filename"]:
- self.pyfile.name = self.api_data["filename"]
+ if self.api_data and self.api_data['filename']:
+ self.pyfile.name = self.api_data['filename']
if self.premium:
self.logDebug("Netload: Use Premium Account")
@@ -113,13 +117,13 @@ class NetloadIn(Hoster):
self.api_data = {}
if src and ";" in src and src not in ("unknown file_data", "unknown_server_data", "No input file specified."):
lines = src.split(";")
- self.api_data["exists"] = True
- self.api_data["fileid"] = lines[0]
- self.api_data["filename"] = lines[1]
- self.api_data["size"] = lines[2]
- self.api_data["status"] = lines[3]
- if self.api_data["status"] == "online":
- self.api_data["checksum"] = lines[4].strip()
+ self.api_data['exists'] = True
+ self.api_data['fileid'] = lines[0]
+ self.api_data['filename'] = lines[1]
+ self.api_data['size'] = lines[2]
+ self.api_data['status'] = lines[3]
+ if self.api_data['status'] == "online":
+ self.api_data['checksum'] = lines[4].strip()
else:
self.api_data = False # check manually since api data is useless sometimes
@@ -151,7 +155,7 @@ class NetloadIn(Hoster):
self.offline()
name = re.search(r'class="dl_first_filename">([^<]+)', page, re.MULTILINE)
- # the found filename is not truncated
+ # the found filename is not truncated
if name:
name = name.group(1).strip()
if not name.endswith(".."):
@@ -176,9 +180,9 @@ class NetloadIn(Hoster):
return True
if ">An access request has been made from IP address <" in page:
wait = self.get_wait_time(page)
- if wait == 0:
+ if not wait:
self.logDebug("Netload: Wait was 0 setting 30")
- wait = 30
+ wait = 30 * 60
self.logInfo(_("Netload: waiting between downloads %d s." % wait))
self.wantReconnect = True
self.setWait(wait)
diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py
index 1de734222..3187dd89f 100644
--- a/module/plugins/hoster/NosuploadCom.py
+++ b/module/plugins/hoster/NosuploadCom.py
@@ -9,7 +9,9 @@ class NosuploadCom(XFileSharingPro):
__name__ = "NosuploadCom"
__type__ = "hoster"
__version__ = "0.1"
+
__pattern__ = r'http://(?:www\.)?nosupload\.com/\?d=\w{12}'
+
__description__ = """Nosupload.com hoster plugin"""
__author_name__ = "igel"
__author_mail__ = "igelkun@myopera.com"
@@ -17,9 +19,10 @@ class NosuploadCom(XFileSharingPro):
HOSTER_NAME = "nosupload.com"
FILE_SIZE_PATTERN = r'<p><strong>Size:</strong> (?P<S>[0-9\.]+) (?P<U>[kKMG]?B)</p>'
- DIRECT_LINK_PATTERN = r'<a class="select" href="(http://.+?)">Download</a>'
+ LINK_PATTERN = r'<a class="select" href="(http://.+?)">Download</a>'
WAIT_PATTERN = r'Please wait.*?>(\d+)</span>'
+
def getDownloadLink(self):
# stage1: press the "Free Download" button
data = self.getPostParameters()
@@ -33,7 +36,7 @@ class NosuploadCom(XFileSharingPro):
self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True)
# stage3: get the download link
- return re.search(self.DIRECT_LINK_PATTERN, self.html, re.S).group(1)
+ return re.search(self.LINK_PATTERN, self.html, re.S).group(1)
getInfo = create_getInfo(NosuploadCom)
diff --git a/module/plugins/hoster/NovafileCom.py b/module/plugins/hoster/NovafileCom.py
index c552c166c..4a89064ea 100644
--- a/module/plugins/hoster/NovafileCom.py
+++ b/module/plugins/hoster/NovafileCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-
-# Test links (random.bin):
+#
+# Test links:
# http://novafile.com/vfun4z6o2cit
# http://novafile.com/s6zrr5wemuz4
@@ -10,8 +10,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class NovafileCom(XFileSharingPro):
__name__ = "NovafileCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?novafile\.com/\w{12}'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?novafile\.com/\w{12}'
+
__description__ = """Novafile.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
@@ -20,9 +22,10 @@ class NovafileCom(XFileSharingPro):
FILE_SIZE_PATTERN = r'<div class="size">(?P<S>.+?)</div>'
ERROR_PATTERN = r'class="alert[^"]*alert-separate"[^>]*>\s*(?:<p>)?(.*?)\s*</'
- DIRECT_LINK_PATTERN = r'<a href="(http://s\d+\.novafile\.com/.*?)" class="btn btn-green">Download File</a>'
+ LINK_PATTERN = r'<a href="(http://s\d+\.novafile\.com/.*?)" class="btn btn-green">Download File</a>'
WAIT_PATTERN = r'<p>Please wait <span id="count"[^>]*>(\d+)</span> seconds</p>'
+
def setup(self):
self.multiDL = False
diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py
index cc1a10da0..193698f17 100644
--- a/module/plugins/hoster/NowDownloadEu.py
+++ b/module/plugins/hoster/NowDownloadEu.py
@@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.utils import fixup
@@ -25,34 +9,38 @@ from module.utils import fixup
class NowDownloadEu(SimpleHoster):
__name__ = "NowDownloadEu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P<ID>\w+)'
__version__ = "0.05"
+
+ __pattern__ = r'http://(?:www\.)?nowdownload\.(ch|co|eu|sx)/(dl/|download\.php\?id=)(?P<ID>\w+)'
+
__description__ = """NowDownload.ch hoster plugin"""
__author_name__ = ("godofdream", "Walter Purcaro")
__author_mail__ = ("soilfiction@gmail.com", "vuolter@gmail.com")
FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>'
- FILE_OFFLINE_PATTERN = r'(This file does not exist!)'
- FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"'
- FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"'
- FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),'
- FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"'
+ OFFLINE_PATTERN = r'(This file does not exist!)'
+
+ TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"'
+ CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"'
+ WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),'
+ LINK_PATTERN = r'"(http://f\d+\.nowdownload\.ch/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"'
FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')]
+
def setup(self):
self.multiDL = self.resumeDownload = True
self.chunkLimit = -1
def handleFree(self):
- tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html)
- continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html)
- if not tokenlink or not continuelink:
+ tokenlink = re.search(self.TOKEN_PATTERN, self.html)
+ continuelink = re.search(self.CONTINUE_PATTERN, self.html)
+ if tokenlink is None or continuelink is None:
self.fail('Plugin out of Date')
- found = re.search(self.FILE_WAIT_PATTERN, self.html)
- if found:
- wait = int(found.group(1))
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ wait = int(m.group(1))
else:
wait = 60
@@ -62,8 +50,8 @@ class NowDownloadEu(SimpleHoster):
self.html = self.load(baseurl + str(continuelink.group(1)))
- url = re.search(self.FILE_DOWNLOAD_LINK, self.html)
- if not url:
+ url = re.search(self.LINK_PATTERN, self.html)
+ if url is None:
self.fail('Download Link not Found (Plugin out of Date?)')
self.logDebug('Download link: ' + str(url.group(1)))
self.download(str(url.group(1)))
diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py
index 1e0508d32..f30c64184 100644
--- a/module/plugins/hoster/OboomCom.py
+++ b/module/plugins/hoster/OboomCom.py
@@ -1,28 +1,31 @@
# -*- coding: utf-8 -*-
-
-# Test link:
+#
+# Test links:
# https://www.oboom.com/B7CYZIEB/10Mio.dat
import re
+from module.common.json_layer import json_loads
from module.plugins.Hoster import Hoster
from module.plugins.internal.CaptchaService import ReCaptcha
-from module.common.json_layer import json_loads
class OboomCom(Hoster):
__name__ = "OboomCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P<ID>[A-Z0-9]{8})'
__version__ = "0.1"
+
+ __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P<ID>[A-Z0-9]{8})'
+
__description__ = """oboom.com hoster plugin"""
__author_name__ = "stanley"
__author_mail__ = "stanley.foerster@gmail.com"
RECAPTCHA_KEY = "6LdqpO0SAAAAAJGHXo63HyalP7H4qlRs_vff0kJX"
+
def loadUrl(self, url, get=None):
- if not get:
+ if get is None:
get = dict()
return json_loads(self.load(url, get, decode=True))
@@ -33,7 +36,7 @@ class OboomCom(Hoster):
if self.premium:
accountInfo = self.account.getAccountInfo(self.user, True)
if "session" in accountInfo:
- self.sessionToken = accountInfo["session"]
+ self.sessionToken = accountInfo['session']
else:
self.fail("Could not retrieve premium session")
else:
@@ -87,9 +90,9 @@ class OboomCom(Hoster):
result = self.loadUrl(apiUrl, params)
if result[0] == 200:
item = result[1][0]
- if item["state"] == "online":
- self.fileSize = item["size"]
- self.fileName = item["name"]
+ if item['state'] == "online":
+ self.fileSize = item['size']
+ self.fileName = item['name']
else:
self.offline()
else:
@@ -99,10 +102,10 @@ class OboomCom(Hoster):
apiUrl = "https://api.oboom.com/1.0/dl"
params = {"item": self.fileId, "http_errors": 0}
if self.premium:
- params["token"] = self.sessionToken
+ params['token'] = self.sessionToken
else:
- params["token"] = self.downloadToken
- params["auth"] = self.downloadAuth
+ params['token'] = self.downloadToken
+ params['auth'] = self.downloadAuth
result = self.loadUrl(apiUrl, params)
if result[0] == 200:
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index 41f3e4b11..0536f7185 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-
-# Test links (random.bin):
+#
+# Test links:
# http://5pnm24ltcw.1fichier.com/
import re
@@ -11,8 +11,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class OneFichierCom(SimpleHoster):
__name__ = "OneFichierCom"
__type__ = "hoster"
- __pattern__ = r'(http://(?P<id>\w+)\.(?P<host>(1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))/?'
__version__ = "0.61"
+
+ __pattern__ = r'(http://(?P<id>\w+)\.(?P<host>(1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))/?'
+
__description__ = """1fichier.com hoster plugin"""
__author_name__ = ("fragonib", "the-razer", "zoidberg", "imclem", "stickell", "Elrick69")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz",
@@ -20,15 +22,16 @@ class OneFichierCom(SimpleHoster):
FILE_NAME_PATTERN = r'">Filename :</th>\s*<td>(?P<N>[^<]+)</td>'
FILE_SIZE_PATTERN = r'<th>Size :</th>\s*<td>(?P<S>[^<]+)</td>'
- FILE_OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)'
+ OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)'
FILE_URL_REPLACEMENTS = [(__pattern__, r'http://\g<id>.\g<host>/en/')]
- WAITING_PATTERN = "Warning ! Without premium status, you must wait between each downloads"
- NOT_PARALLEL = r"Warning ! Without premium status, you can download only one file at a time"
+ WAITING_PATTERN = r'Warning ! Without premium status, you must wait between each downloads'
+ NOT_PARALLEL = r'Warning ! Without premium status, you can download only one file at a time'
WAIT_TIME = 10 * 60 # Retry time between each free download
RETRY_TIME = 15 * 60 # Default retry time in seconds (if detected parallel download)
+
def setup(self):
self.multiDL = self.premium
self.resumeDownload = True
@@ -40,22 +43,22 @@ class OneFichierCom(SimpleHoster):
self.logInfo('You have to wait been each free download! Retrying in %d seconds.' % self.WAIT_TIME)
self.waitAndRetry(self.WAIT_TIME)
else: # detect parallel download
- found = re.search(self.NOT_PARALLEL, self.html)
- if found:
+ m = re.search(self.NOT_PARALLEL, self.html)
+ if m:
self.waitAndRetry(self.RETRY_TIME)
url, inputs = self.parseHtmlForm('action="http://%s' % self.file_info['id'])
if not url:
self.parseError("Download link not found")
- # Check for protection
+ # Check for protection
if "pass" in inputs:
inputs['pass'] = self.getPassword()
inputs['submit'] = "Download"
self.download(url, post=inputs)
- # Check download
+ # Check download
self.checkDownloadedFile()
def handlePremium(self):
@@ -83,4 +86,5 @@ class OneFichierCom(SimpleHoster):
self.retry()
+
getInfo = create_getInfo(OneFichierCom)
diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py
index aaa1442e4..7b7c83893 100644
--- a/module/plugins/hoster/OverLoadMe.py
+++ b/module/plugins/hoster/OverLoadMe.py
@@ -1,23 +1,27 @@
# -*- coding: utf-8 -*-
import re
-from urllib import unquote
+
from random import randrange
+from urllib import unquote
-from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
from module.utils import parseFileSize
class OverLoadMe(Hoster):
__name__ = "OverLoadMe"
- __version__ = "0.01"
__type__ = "hoster"
+ __version__ = "0.01"
+
__pattern__ = r'https?://.*overload\.me.*'
+
__description__ = """Over-Load.me hoster plugin"""
__author_name__ = "marley"
__author_mail__ = "marley@over-load.me"
+
def getFilename(self, url):
try:
name = unquote(url.rsplit("/", 1)[1])
@@ -42,19 +46,19 @@ class OverLoadMe(Hoster):
data = self.account.getAccountData(self.user)
page = self.load("https://api.over-load.me/getdownload.php",
- get={"auth": data["password"], "link": pyfile.url})
+ get={"auth": data['password'], "link": pyfile.url})
data = json_loads(page)
self.logDebug("Returned Data: %s" % data)
- if data["err"] == 1:
- self.logWarning(data["msg"])
+ if data['err'] == 1:
+ self.logWarning(data['msg'])
self.tempOffline()
else:
- if pyfile.name is not None and pyfile.name.endswith('.tmp') and data["filename"]:
- pyfile.name = data["filename"]
- pyfile.size = parseFileSize(data["filesize"])
- new_url = data["downloadlink"]
+ if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['filename']:
+ pyfile.name = data['filename']
+ pyfile.size = parseFileSize(data['filesize'])
+ new_url = data['downloadlink']
if self.getConfig("https"):
new_url = new_url.replace("http://", "https://")
diff --git a/module/plugins/hoster/PandaPlanet.py b/module/plugins/hoster/PandaPlanet.py
index b6aa77b03..6f852ac9a 100644
--- a/module/plugins/hoster/PandaPlanet.py
+++ b/module/plugins/hoster/PandaPlanet.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-
+#
# Test links:
# test.bin - 214 B - http://pandapla.net/pew1cz3ot586
# BigBuckBunny_320x180.mp4 - 61.7 Mb - http://pandapla.net/tz0rgjfyyoh7
@@ -10,8 +10,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class PandaPlanet(XFileSharingPro):
__name__ = "PandaPlanet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?pandapla\.net/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?pandapla\.net/\w{12}'
+
__description__ = """Pandapla.net hoster plugin"""
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
@@ -20,7 +22,7 @@ class PandaPlanet(XFileSharingPro):
FILE_SIZE_PATTERN = r'File Size:</b>\s*</td>\s*<td[^>]*>(?P<S>[^<]+)</td>\s*</tr>'
FILE_NAME_PATTERN = r'File Name:</b>\s*</td>\s*<td[^>]*>(?P<N>[^<]+)</td>\s*</tr>'
- DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+\/(?!video\.mp4)[^"\'<]+)' % HOSTER_NAME
+ LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+\/(?!video\.mp4)[^"\'<]+)' % HOSTER_NAME
getInfo = create_getInfo(PandaPlanet)
diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py
index 61b382c81..f0621c420 100644
--- a/module/plugins/hoster/PornhostCom.py
+++ b/module/plugins/hoster/PornhostCom.py
@@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
class PornhostCom(Hoster):
__name__ = "PornhostCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)'
__version__ = "0.2"
+
+ __pattern__ = r'http://(?:www\.)?pornhost\.com/([0-9]+/[0-9]+\.html|[0-9]+)'
+
__description__ = """Pornhost.com hoster plugin"""
__author_name__ = "jeix"
__author_mail__ = "jeix@hasnomail.de"
+
def process(self, pyfile):
self.download_html()
if not self.file_exists():
@@ -21,7 +25,7 @@ class PornhostCom(Hoster):
pyfile.name = self.get_file_name()
self.download(self.get_file_url())
- ### old interface
+ # Old interface
def download_html(self):
url = self.pyfile.url
self.html = self.load(url)
@@ -29,32 +33,30 @@ class PornhostCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
- file_url = re.search(r'download this file</label>.*?<a href="(.*?)"', self.html)
- if not file_url:
- file_url = re.search(r'"(http://dl[0-9]+\.pornhost\.com/files/.*?/.*?/.*?/.*?/.*?/.*?\..*?)"', self.html)
- if not file_url:
- file_url = re.search(r'width: 894px; height: 675px">.*?<img src="(.*?)"', self.html)
- if not file_url:
- file_url = re.search(r'"http://file[0-9]+\.pornhost\.com/[0-9]+/.*?"',
- self.html) # TODO: fix this one since it doesn't match
-
- file_url = file_url.group(1).strip()
+ url = re.search(r'download this file</label>.*?<a href="(.*?)"', self.html)
+ if url is None:
+ url = re.search(r'"(http://dl[0-9]+\.pornhost\.com/files/.*?/.*?/.*?/.*?/.*?/.*?\..*?)"', self.html)
+ if url is None:
+ url = re.search(r'width: 894px; height: 675px">.*?<img src="(.*?)"', self.html)
+ if url is None:
+ url = re.search(r'"http://file[0-9]+\.pornhost\.com/[0-9]+/.*?"',
+ self.html) # TODO: fix this one since it doesn't match
- return file_url
+ return url.group(1).strip()
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
name = re.search(r'<title>pornhost\.com - free file hosting with a twist - gallery(.*?)</title>', self.html)
- if not name:
+ if name is None:
name = re.search(r'id="url" value="http://www\.pornhost\.com/(.*?)/"', self.html)
- if not name:
+ if name is None:
name = re.search(r'<title>pornhost\.com - free file hosting with a twist -(.*?)</title>', self.html)
- if not name:
+ if name is None:
name = re.search(r'"http://file[0-9]+\.pornhost\.com/.*?/(.*?)"', self.html)
name = name.group(1).strip() + ".flv"
@@ -64,7 +66,7 @@ class PornhostCom(Hoster):
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if (re.search(r'gallery not found', self.html) is not None or
diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py
index 29205b381..cecdc4339 100644
--- a/module/plugins/hoster/PornhubCom.py
+++ b/module/plugins/hoster/PornhubCom.py
@@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
class PornhubCom(Hoster):
__name__ = "PornhubCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=[\w\d]+'
__version__ = "0.5"
+
+ __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=[\w\d]+'
+
__description__ = """Pornhub.com hoster plugin"""
__author_name__ = "jeix"
__author_mail__ = "jeix@hasnomail.de"
+
def process(self, pyfile):
self.download_html()
if not self.file_exists():
@@ -28,7 +32,7 @@ class PornhubCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
url = "http://www.pornhub.com//gateway.php"
@@ -51,17 +55,15 @@ class PornhubCom(Hoster):
content = new_content
- file_url = re.search(r'flv_url.*(http.*?)##post_roll', content).group(1)
-
- return file_url
+ return re.search(r'flv_url.*(http.*?)##post_roll', content).group(1)
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
- match = re.search(r'<title[^>]+>([^<]+) - ', self.html)
- if match:
- name = match.group(1)
+ m = re.search(r'<title[^>]+>([^<]+) - ', self.html)
+ if m:
+ name = m.group(1)
else:
matches = re.findall('<h1>(.*?)</h1>', self.html)
if len(matches) > 1:
@@ -74,7 +76,7 @@ class PornhubCom(Hoster):
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r'This video is no longer in our database or is in conversion', self.html) is not None:
diff --git a/module/plugins/hoster/PotloadCom.py b/module/plugins/hoster/PotloadCom.py
index ffcfad1a5..087b7a265 100644
--- a/module/plugins/hoster/PotloadCom.py
+++ b/module/plugins/hoster/PotloadCom.py
@@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
+
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
class PotloadCom(XFileSharingPro):
__name__ = "PotloadCom"
__type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?potload\.com/\w{12}"
__version__ = "0.01"
- __description__ = """billionuploads.com hoster plugin"""
- __author_name__ = ("stickell")
- __author_mail__ = ("l.stickell@yahoo.it")
- FILE_INFO_PATTERN = r'<h[1-6]>(?P<N>.+) \((?P<S>\d+) (?P<U>\w+)\)</h'
+ __pattern__ = r'http://(?:www\.)?potload\.com/\w{12}'
+
+ __description__ = """Potload.com hoster plugin"""
+ __author_name__ = "stickell"
+ __author_mail__ = "l.stickell@yahoo.it"
+
HOSTER_NAME = "potload.com"
+ FILE_INFO_PATTERN = r'<h[1-6]>(?P<N>.+) \((?P<S>\d+) (?P<U>\w+)\)</h'
+
getInfo = create_getInfo(PotloadCom)
diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/Premium4Me.py
index e66e76ce1..ea841338a 100644
--- a/module/plugins/hoster/Premium4Me.py
+++ b/module/plugins/hoster/Premium4Me.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-from urllib import quote
-from os.path import exists
from os import remove
+from os.path import exists
+from urllib import quote
from module.plugins.Hoster import Hoster
from module.utils import fs_encode
@@ -10,14 +10,16 @@ from module.utils import fs_encode
class Premium4Me(Hoster):
__name__ = "Premium4Me"
- __version__ = "0.08"
__type__ = "hoster"
+ __version__ = "0.08"
__pattern__ = r'http://(?:www\.)?premium.to/.*'
+
__description__ = """Premium.to hoster plugin"""
__author_name__ = ("RaNaN", "zoidberg", "stickell")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
def setup(self):
self.resumeDownload = True
self.chunkLimit = 1
diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py
index 7e646fdf9..7d0ca9ed2 100644
--- a/module/plugins/hoster/PremiumizeMe.py
+++ b/module/plugins/hoster/PremiumizeMe.py
@@ -1,23 +1,21 @@
# -*- coding: utf-8 -*-
-from module.plugins.Hoster import Hoster
-
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
class PremiumizeMe(Hoster):
__name__ = "PremiumizeMe"
- __version__ = "0.12"
__type__ = "hoster"
- __description__ = """Premiumize.me hoster plugin"""
+ __version__ = "0.12"
- # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady
- # create the regex patterns for us using getHosters in our PremiumizeMe hook.
- __pattern__ = None
+ __pattern__ = None #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady
+ __description__ = """Premiumize.me hoster plugin"""
__author_name__ = "Florian Franzen"
__author_mail__ = "FlorianFranzen@gmail.com"
+
def process(self, pyfile):
# Check account
if not self.account or not self.account.canUse():
diff --git a/module/plugins/hoster/PromptfileCom.py b/module/plugins/hoster/PromptfileCom.py
index 3580a9509..d16af7e5a 100644
--- a/module/plugins/hoster/PromptfileCom.py
+++ b/module/plugins/hoster/PromptfileCom.py
@@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -23,21 +8,25 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class PromptfileCom(SimpleHoster):
__name__ = "PromptfileCom"
__type__ = "hoster"
- __pattern__ = r"https?://(?:www\.)?promptfile\.com/"
__version__ = "0.1"
- __description__ = """Promptfile.Com File Download Hoster"""
- __author_name__ = ("igel")
+
+ __pattern__ = r'https?://(?:www\.)?promptfile\.com/'
+
+ __description__ = """Promptfile.com hoster plugin"""
+ __author_name__ = "igel"
+ __author_mail__ = "igelkun@myopera.com"
FILE_INFO_PATTERN = r'<span style="[^"]*" title="[^"]*">(?P<N>.*?) \((?P<S>[\d.]+) (?P<U>\w+)\)</span>'
- FILE_OFFLINE_PATTERN = r'<span style="[^"]*" title="File Not Found">File Not Found</span>'
+ OFFLINE_PATTERN = r'<span style="[^"]*" title="File Not Found">File Not Found</span>'
CHASH_PATTERN = r'<input type="hidden" name="chash" value="([^"]*)" />'
- DIRECT_LINK_PATTERN = r"clip: {\s*url: '(https?://(?:www\.)promptfile[^']*)',"
+ LINK_PATTERN = r"clip: {\s*url: '(https?://(?:www\.)promptfile[^']*)',"
+
def handleFree(self):
# STAGE 1: get link to continue
m = re.search(self.CHASH_PATTERN, self.html)
- if not m:
+ if m is None:
self.parseError("Unable to detect chash")
chash = m.group(1)
self.logDebug("read chash %s" % chash)
@@ -45,11 +34,11 @@ class PromptfileCom(SimpleHoster):
self.html = self.load(self.pyfile.url, decode=True, post={'chash': chash})
# STAGE 2: get the direct link
- m = re.search(self.DIRECT_LINK_PATTERN, self.html, re.MULTILINE | re.DOTALL)
- if not m:
+ m = re.search(self.LINK_PATTERN, self.html, re.MULTILINE | re.DOTALL)
+ if m is None:
self.parseError("Unable to detect direct link")
direct = m.group(1)
- self.logDebug('found direct link: ' + direct)
+ self.logDebug("found direct link: " + direct)
self.download(direct, disposition=True)
diff --git a/module/plugins/hoster/PutlockerCom.py b/module/plugins/hoster/PutlockerCom.py
deleted file mode 100644
index a453eaf62..000000000
--- a/module/plugins/hoster/PutlockerCom.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
-
-import re
-
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-
-
-class PutlockerCom(SimpleHoster):
- __name__ = "PutlockerCom"
- __type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
- __version__ = "0.33"
- __description__ = """Firedrive.com hoster plugin"""
- __author_name__ = "Walter Purcaro"
- __author_mail__ = "vuolter@gmail.com"
-
- FILE_NAME_PATTERN = r'<b>Name:</b> (?P<N>.+) <br>'
- FILE_SIZE_PATTERN = r'<b>Size:</b> (?P<S>[\d.]+) (?P<U>[a-zA-Z]+) <br>'
- FILE_OFFLINE_PATTERN = r"<div class=\"sad_face_image\">"
-
- FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.firedrive.com/file/\g<ID>')]
-
- def setup(self):
- self.multiDL = self.resumeDownload = True
- self.chunkLimit = -1
-
- def handleFree(self):
- link = self._getLink()
- self.logDebug("Direct link: " + link)
- self.download(link, disposition=True)
-
- def _getLink(self):
- self.html = self.load(self.pyfile.url, post={"confirm": re.search(r'name="confirm" value="(.*)"', self.html).group(1)})
- return re.search(r'<a href="(https?://dl\.firedrive\.com/.*?)"', self.html).group(1)
-
-
-getInfo = create_getInfo(PutlockerCom)
diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py
index 46639444e..972effffb 100644
--- a/module/plugins/hoster/QuickshareCz.py
+++ b/module/plugins/hoster/QuickshareCz.py
@@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from pycurl import FOLLOWLOCATION
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -26,15 +10,18 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class QuickshareCz(SimpleHoster):
__name__ = "QuickshareCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:[^/]*\.)?quickshare.cz/stahnout-soubor/.*'
__version__ = "0.54"
+
+ __pattern__ = r'http://(?:[^/]*\.)?quickshare.cz/stahnout-soubor/.*'
+
__description__ = """Quickshare.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<th width="145px">Název:</th>\s*<td style="word-wrap:break-word;">(?P<N>[^<]+)</td>'
FILE_SIZE_PATTERN = r'<th>Velikost:</th>\s*<td>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</td>'
- FILE_OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>'
+ OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>'
+
def process(self, pyfile):
self.html = self.load(pyfile.url, decode=True)
@@ -63,12 +50,12 @@ class QuickshareCz(SimpleHoster):
check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100)
if check == "err":
- self.fail("File not found or plugin defect")
+ self.fail("File not m or plugin defect")
def handleFree(self):
# get download url
download_url = '%s/download.php' % self.jsvars['server']
- data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID3', 'ID4'))
+ data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID3", "ID4"))
self.logDebug("FREE URL1:" + download_url, data)
self.req.http.c.setopt(FOLLOWLOCATION, 0)
@@ -76,28 +63,28 @@ class QuickshareCz(SimpleHoster):
self.header = self.req.http.header
self.req.http.c.setopt(FOLLOWLOCATION, 1)
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if not found:
+ m = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ if m is None:
self.fail('File not found')
- download_url = found.group(1)
+ download_url = m.group(1)
self.logDebug("FREE URL2:" + download_url)
# check errors
- found = re.search(r'/chyba/(\d+)', download_url)
- if found:
- if found.group(1) == '1':
+ m = re.search(r'/chyba/(\d+)', download_url)
+ if m:
+ if m.group(1) == '1':
self.retry(60, 2 * 60, "This IP is already downloading")
- elif found.group(1) == '2':
+ elif m.group(1) == '2':
self.retry(60, 60, "No free slots available")
else:
- self.fail('Error %d' % found.group(1))
+ self.fail('Error %d' % m.group(1))
# download file
self.download(download_url)
def handlePremium(self):
download_url = '%s/download_premium.php' % self.jsvars['server']
- data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID4', 'ID5'))
+ data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID4", "ID5"))
self.logDebug("PREMIUM URL:" + download_url, data)
self.download(download_url, get=data)
diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py
index 57c22698d..47f255074 100644
--- a/module/plugins/hoster/RPNetBiz.py
+++ b/module/plugins/hoster/RPNetBiz.py
@@ -8,19 +8,21 @@ from module.common.json_layer import json_loads
class RPNetBiz(Hoster):
__name__ = "RPNetBiz"
- __version__ = "0.1"
__type__ = "hoster"
+ __version__ = "0.1"
+
__description__ = """RPNet.biz hoster plugin"""
+
__pattern__ = r'https?://.*rpnet\.biz'
__author_name__ = "Dman"
__author_mail__ = "dmanugm@gmail.com"
+
def setup(self):
self.chunkLimit = -1
self.resumeDownload = True
def process(self, pyfile):
-
if re.match(self.__pattern__, pyfile.url):
link_status = {'generated': pyfile.url}
elif not self.account:
@@ -31,7 +33,7 @@ class RPNetBiz(Hoster):
(user, data) = self.account.selectAccount()
self.logDebug("Original URL: %s" % pyfile.url)
- # Get the download link
+ # Get the download link
response = self.load("https://premium.rpnet.biz/client_api.php",
get={"username": user, "password": data['password'],
"action": "generate", "links": pyfile.url})
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index b966fd1d6..ce4d9ab36 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -1,55 +1,44 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: zoidberg
-###############################################################################
import re
+
from pycurl import HTTPHEADER
from module.common.json_layer import json_loads
from module.network.HTTPRequest import BadHeader
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
+from module.plugins.internal.CaptchaService import AdsCaptcha, ReCaptcha, SolveMedia
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia, AdsCaptcha
class RapidgatorNet(SimpleHoster):
__name__ = "RapidgatorNet"
__type__ = "hoster"
+ __version__ = "0.22"
+
__pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+'
- __version__ = "0.21"
+
__description__ = """Rapidgator.net hoster plugin"""
__author_name__ = ("zoidberg", "chrox", "stickell", "Walter Purcaro")
__author_mail__ = ("zoidberg@mujmail.cz", "", "l.stickell@yahoo.it", "vuolter@gmail.com")
- API_URL = 'http://rapidgator.net/api/file'
+ API_URL = "http://rapidgator.net/api/file"
FILE_NAME_PATTERN = r'<title>Download file (?P<N>.*)</title>'
FILE_SIZE_PATTERN = r'File size:\s*<strong>(?P<S>[\d\.]+) (?P<U>\w+)</strong>'
- FILE_OFFLINE_PATTERN = r'>(File not found|Error 404)'
+ OFFLINE_PATTERN = r'>(File not found|Error 404)'
JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;"
PREMIUM_ONLY_ERROR_PATTERN = r'You can download files up to|This file can be downloaded by premium only<'
DOWNLOAD_LIMIT_ERROR_PATTERN = r'You have reached your (daily|hourly) downloads limit'
WAIT_PATTERN = r'(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)'
- DOWNLOAD_LINK_PATTERN = r"return '(http://\w+.rapidgator.net/.*)';"
+ LINK_PATTERN = r"return '(http://\w+.rapidgator.net/.*)';"
RECAPTCHA_KEY_PATTERN = r'"http://api\.recaptcha\.net/challenge\?k=(.*?)"'
ADSCAPTCHA_SRC_PATTERN = r'(http://api\.adscaptcha\.com/Get\.aspx[^"\']*)'
SOLVEMEDIA_PATTERN = r'http://api\.solvemedia\.com/papi/challenge\.script\?k=(.*?)"'
+
def setup(self):
self.resumeDownload = self.multiDL = self.premium
self.sid = None
@@ -109,13 +98,13 @@ class RapidgatorNet(SimpleHoster):
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
url = "http://rapidgator.net%s?fid=%s" % (
- jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"])
+ jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars['fid'])
jsvars.update(self.getJsonResponse(url))
self.wait(int(jsvars.get('secs', 45)) + 1, False)
url = "http://rapidgator.net%s?sid=%s" % (
- jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars["sid"])
+ jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars['sid'])
jsvars.update(self.getJsonResponse(url))
self.req.http.lastURL = self.pyfile.url
@@ -125,9 +114,9 @@ class RapidgatorNet(SimpleHoster):
self.html = self.load(url)
for _ in xrange(5):
- found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if found:
- link = found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m:
+ link = m.group(1)
self.logDebug(link)
self.download(link, disposition=True)
break
@@ -149,19 +138,19 @@ class RapidgatorNet(SimpleHoster):
self.parseError("Download link")
def getCaptcha(self):
- found = re.search(self.ADSCAPTCHA_SRC_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.ADSCAPTCHA_SRC_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
captcha = AdsCaptcha(self)
else:
- found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.RECAPTCHA_KEY_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
captcha = ReCaptcha(self)
else:
- found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
captcha = SolveMedia(self)
else:
self.parseError("Captcha")
@@ -169,25 +158,26 @@ class RapidgatorNet(SimpleHoster):
return captcha, captcha_key
def checkFree(self):
- found = re.search(self.PREMIUM_ONLY_ERROR_PATTERN, self.html)
- if found:
+ m = re.search(self.PREMIUM_ONLY_ERROR_PATTERN, self.html)
+ if m:
self.fail("Premium account needed for download")
else:
- found = re.search(self.WAIT_PATTERN, self.html)
+ m = re.search(self.WAIT_PATTERN, self.html)
- if found:
- wait_time = int(found.group(1)) * {"hour": 60, "min": 1}[found.group(2)]
+ if m:
+ wait_time = int(m.group(1)) * {"hour": 60, "min": 1}[m.group(2)]
else:
- found = re.search(self.DOWNLOAD_LIMIT_ERROR_PATTERN, self.html)
- if not found:
+ m = re.search(self.DOWNLOAD_LIMIT_ERROR_PATTERN, self.html)
+ if m is None:
return
- elif found.group(1) == "daily":
- wait_time = 60
+ elif m.group(1) == "daily":
+ self.logWarning("You have reached your daily downloads limit for today")
+ wait_time = secondsToMidnight(gmt=2)
else:
- wait_time = 24 * 60
+ wait_time = 1 * 60 * 60
- self.logDebug("Waiting %d minutes" % wait_time)
- self.wait(wait_time * 60, True)
+ self.logDebug("Waiting %d minutes" % wait_time / 60)
+ self.wait(wait_time, True)
self.retry()
def getJsonResponse(self, url):
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py
index e5ab6b445..19d6cf772 100644
--- a/module/plugins/hoster/RapidshareCom.py
+++ b/module/plugins/hoster/RapidshareCom.py
@@ -1,12 +1,5 @@
# -*- coding: utf-8 -*-
-# v1.36
-# * fixed call checkfiles subroutine
-# v1.35
-# * fixed rs-urls in handleFree(..) and freeWait(..)
-# * removed getInfo(..) function as it was not used anywhere (in this file)
-# * removed some (old?) comment blocks
-
import re
from module.network.RequestFactory import getURL
@@ -51,15 +44,18 @@ def getInfo(urls):
class RapidshareCom(Hoster):
__name__ = "RapidshareCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))'
__version__ = "1.39"
- __description__ = """Rapidshare.com hoster plugin"""
+
+ __pattern__ = r'https?://(?:www\.)?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))'
__config__ = [("server",
"Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera",
"Preferred Server", "None")]
+
+ __description__ = """Rapidshare.com hoster plugin"""
__author_name__ = ("spoob", "RaNaN", "mkaay")
__author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de")
+
def setup(self):
self.no_download = True
self.api_data = None
@@ -87,7 +83,7 @@ class RapidshareCom(Hoster):
self.name = m.group("name_new")
self.download_api_data()
- if self.api_data["status"] == "1":
+ if self.api_data['status'] == "1":
self.pyfile.name = self.get_file_name()
if self.premium:
@@ -95,21 +91,20 @@ class RapidshareCom(Hoster):
else:
self.handleFree()
- elif self.api_data["status"] == "2":
+ elif self.api_data['status'] == "2":
self.logInfo(_("Rapidshare: Traffic Share (direct download)"))
self.pyfile.name = self.get_file_name()
self.download(self.pyfile.url, get={"directstart": 1})
- elif self.api_data["status"] in ("0", "4", "5"):
+ elif self.api_data['status'] in ("0", "4", "5"):
self.offline()
- elif self.api_data["status"] == "3":
+ elif self.api_data['status'] == "3":
self.tempOffline()
else:
self.fail("Unknown response code.")
def handleFree(self):
-
while self.no_download:
self.dl_dict = self.freeWait()
@@ -134,7 +129,7 @@ class RapidshareCom(Hoster):
def handlePremium(self):
info = self.account.getAccountInfo(self.user, True)
self.logDebug("%s: Use Premium Account" % self.__name__)
- url = self.api_data["mirror"]
+ url = self.api_data['mirror']
self.download(url, get={"directstart": 1})
def download_api_data(self, force=False):
@@ -164,12 +159,12 @@ class RapidshareCom(Hoster):
self.api_data = {"fileid": fields[0], "filename": fields[1], "size": int(fields[2]), "serverid": fields[3],
"status": fields[4], "shorthost": fields[5], "checksum": fields[6].strip().lower()}
- if int(self.api_data["status"]) > 100:
- self.api_data["status"] = str(int(self.api_data["status"]) - 100)
- elif int(self.api_data["status"]) > 50:
- self.api_data["status"] = str(int(self.api_data["status"]) - 50)
+ if int(self.api_data['status']) > 100:
+ self.api_data['status'] = str(int(self.api_data['status']) - 100)
+ elif int(self.api_data['status']) > 50:
+ self.api_data['status'] = str(int(self.api_data['status']) - 50)
- self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data
+ self.api_data['mirror'] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data
def freeWait(self):
"""downloads html with the important information
@@ -215,14 +210,14 @@ class RapidshareCom(Hoster):
"name": name,
"host": data[0],
"auth": data[1],
- "server": self.api_data["serverid"],
- "size": self.api_data["size"]}
+ "server": self.api_data['serverid'],
+ "size": self.api_data['size']}
self.setWait(int(data[2]) + 2 + self.offset)
self.wait()
return dl_dict
def get_file_name(self):
- if self.api_data["filename"]:
- return self.api_data["filename"]
+ if self.api_data['filename']:
+ return self.api_data['filename']
return self.url.split("/")[-1]
diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py
index 8f2aacbcf..51df5c882 100644
--- a/module/plugins/hoster/RarefileNet.py
+++ b/module/plugins/hoster/RarefileNet.py
@@ -9,8 +9,10 @@ from module.utils import html_unescape
class RarefileNet(XFileSharingPro):
__name__ = "RarefileNet"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?rarefile.net/\w{12}'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?rarefile.net/\w{12}'
+
__description__ = """Rarefile.net hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -19,7 +21,8 @@ class RarefileNet(XFileSharingPro):
FILE_NAME_PATTERN = r'<td><font color="red">(?P<N>.*?)</font></td>'
FILE_SIZE_PATTERN = r'<td>Size : (?P<S>.+?)&nbsp;'
- DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>'
+ LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>'
+
def setup(self):
self.resumeDownload = self.multiDL = self.premium
diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py
index 36fcd194c..de7540628 100644
--- a/module/plugins/hoster/RealdebridCom.py
+++ b/module/plugins/hoster/RealdebridCom.py
@@ -1,25 +1,28 @@
# -*- coding: utf-8 -*-
import re
-from time import time
-from urllib import quote, unquote
+
from random import randrange
+from urllib import quote, unquote
+from time import time
-from module.utils import parseFileSize
from module.common.json_layer import json_loads
from module.plugins.Hoster import Hoster
+from module.utils import parseFileSize
class RealdebridCom(Hoster):
__name__ = "RealdebridCom"
- __version__ = "0.53"
__type__ = "hoster"
+ __version__ = "0.53"
__pattern__ = r'https?://(?:[^/]*\.)?real-debrid\..*'
+
__description__ = """Real-Debrid.com hoster plugin"""
__author_name__ = "Devirex Hazzard"
__author_mail__ = "naibaf_11@yahoo.de"
+
def getFilename(self, url):
try:
name = unquote(url.rsplit("/", 1)[1])
@@ -54,16 +57,16 @@ class RealdebridCom(Hoster):
self.logDebug("Returned Data: %s" % data)
- if data["error"] != 0:
- if data["message"] == "Your file is unavailable on the hoster.":
+ if data['error'] != 0:
+ if data['message'] == "Your file is unavailable on the hoster.":
self.offline()
else:
- self.logWarning(data["message"])
+ self.logWarning(data['message'])
self.tempOffline()
else:
- if pyfile.name is not None and pyfile.name.endswith('.tmp') and data["file_name"]:
- pyfile.name = data["file_name"]
- pyfile.size = parseFileSize(data["file_size"])
+ if pyfile.name is not None and pyfile.name.endswith('.tmp') and data['file_name']:
+ pyfile.name = data['file_name']
+ pyfile.size = parseFileSize(data['file_size'])
new_url = data['generated_links'][0][-1]
if self.getConfig("https"):
diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py
index a2bbf3883..bdb948d6d 100644
--- a/module/plugins/hoster/RedtubeCom.py
+++ b/module/plugins/hoster/RedtubeCom.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
from module.unescape import unescape
@@ -8,12 +9,15 @@ from module.unescape import unescape
class RedtubeCom(Hoster):
__name__ = "RedtubeCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?redtube\.com/\d+'
__version__ = "0.2"
+
+ __pattern__ = r'http://(?:www\.)?redtube\.com/\d+'
+
__description__ = """Redtube.com hoster plugin"""
__author_name__ = "jeix"
__author_mail__ = "jeix@hasnomail.de"
+
def process(self, pyfile):
self.download_html()
if not self.file_exists():
@@ -29,7 +33,7 @@ class RedtubeCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
file_url = unescape(re.search(r'hashlink=(http.*?)"', self.html).group(1))
@@ -37,16 +41,15 @@ class RedtubeCom(Hoster):
return file_url
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
- name = re.search('<title>(.*?)- RedTube - Free Porn Videos</title>', self.html).group(1).strip() + ".flv"
- return name
+ return re.search('<title>(.*?)- RedTube - Free Porn Videos</title>', self.html).group(1).strip() + ".flv"
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r'This video has been removed.', self.html) is not None:
diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py
index 94e53520a..98fb10d94 100644
--- a/module/plugins/hoster/RehostTo.py
+++ b/module/plugins/hoster/RehostTo.py
@@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
from urllib import quote, unquote
+
from module.plugins.Hoster import Hoster
class RehostTo(Hoster):
__name__ = "RehostTo"
- __version__ = "0.13"
__type__ = "hoster"
+ __version__ = "0.13"
+
__pattern__ = r'https?://.*rehost.to\..*'
+
__description__ = """Rehost.com hoster plugin"""
__author_name__ = "RaNaN"
__author_mail__ = "RaNaN@pyload.org"
+
def getFilename(self, url):
return unquote(url.rsplit("/", 1)[1])
@@ -26,7 +30,7 @@ class RehostTo(Hoster):
self.fail("No rehost.to account provided")
data = self.account.getAccountInfo(self.user)
- long_ses = data["long_ses"]
+ long_ses = data['long_ses']
self.logDebug("Rehost.to: Old URL: %s" % pyfile.url)
new_url = "http://rehost.to/process_download.php?user=cookie&pass=%s&dl=%s" % (long_ses, quote(pyfile.url, ""))
diff --git a/module/plugins/hoster/ReloadCc.py b/module/plugins/hoster/ReloadCc.py
deleted file mode 100644
index ed1b21aa3..000000000
--- a/module/plugins/hoster/ReloadCc.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.Hoster import Hoster
-
-from module.common.json_layer import json_loads
-
-from module.network.HTTPRequest import BadHeader
-
-
-class ReloadCc(Hoster):
- __name__ = "ReloadCc"
- __version__ = "0.5"
- __type__ = "hoster"
- __description__ = """Reload.cc hoster plugin"""
-
- # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady
- # create the regex patterns for us using getHosters in our ReloadCc hook.
- __pattern__ = None
-
- __author_name__ = "Reload Team"
- __author_mail__ = "hello@reload.cc"
-
- def process(self, pyfile):
- # Check account
- if not self.account or not self.account.canUse():
- self.logError(_("Please enter your %s account or deactivate this plugin") % "reload.cc")
- self.fail("No valid reload.cc account provided")
-
- # In some cases hostsers do not supply us with a filename at download, so we
- # are going to set a fall back filename (e.g. for freakshare or xfileshare)
- pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash
-
- # Correction for automatic assigned filename: Removing html at end if needed
- suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"]
- temp = pyfile.name.split('.')
- if temp.pop() in suffix_to_remove:
- pyfile.name = ".".join(temp)
-
- # Get account data
- (user, data) = self.account.selectAccount()
-
- query_params = dict(
- via='pyload',
- v=1,
- user=user,
- uri=pyfile.url
- )
-
- try:
- query_params.update(dict(hash=self.account.infos[user]['pwdhash']))
- except Exception:
- query_params.update(dict(pwd=data['password']))
-
- try:
- answer = self.load("http://api.reload.cc/dl", get=query_params)
- except BadHeader, e:
- if e.code == 400:
- self.fail("The URI is not supported by Reload.cc.")
- elif e.code == 401:
- self.fail("Wrong username or password")
- elif e.code == 402:
- self.fail("Your account is inactive. A payment is required for downloading!")
- elif e.code == 403:
- self.fail("Your account is disabled. Please contact the Reload.cc support!")
- elif e.code == 409:
- self.logWarning("The hoster seems to be a limited hoster and you've used your daily traffic for this hoster: %s" % pyfile.url)
- # Wait for 6 hours and retry up to 4 times => one day
- self.retry(4, 6 * 60 * 60, "Limited hoster traffic limit exceeded")
- elif e.code == 429:
- # Too many connections, wait 2 minutes and try again
- self.retry(5, 2 * 60, "Too many concurrent connections")
- elif e.code == 503:
- # Retry in 10 minutes
- self.retry(wait_time=10 * 60,
- reason="Reload.cc is currently in maintenance mode! Please check again later.")
- else:
- self.fail(
- "Internal error within Reload.cc. Please contact the Reload.cc support for further information.")
- return
-
- data = json_loads(answer)
-
- # Check status and decide what to do
- status = data.get('status', None)
- if status == "ok":
- conn_limit = data.get('msg', 0)
- # API says these connections are limited
- # Make sure this limit is used - the download will fail if not
- if conn_limit > 0:
- try:
- self.limitDL = int(conn_limit)
- except ValueError:
- self.limitDL = 1
- else:
- self.limitDL = 0
-
- try:
- self.download(data['link'], disposition=True)
- except BadHeader, e:
- if e.code == 404:
- self.fail("File Not Found")
- elif e.code == 412:
- self.fail("File access password is wrong")
- elif e.code == 417:
- self.fail("Password required for file access")
- elif e.code == 429:
- # Too many connections, wait 2 minutes and try again
- self.retry(5, 2 * 60, "Too many concurrent connections")
- else:
- self.fail(
- "Internal error within Reload.cc. Please contact the Reload.cc support for further information."
- )
- return
- else:
- self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.")
diff --git a/module/plugins/hoster/RemixshareCom.py b/module/plugins/hoster/RemixshareCom.py
new file mode 100644
index 000000000..ea396495e
--- /dev/null
+++ b/module/plugins/hoster/RemixshareCom.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+#
+# Test links:
+# http://remixshare.com/download/p946u
+#
+# Note:
+# The remixshare.com website is very very slow, so
+# if your download not starts because of pycurl timeouts:
+# Adjust timeouts in /usr/share/pyload/module/network/HTTPRequest.py
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class RemixshareCom(SimpleHoster):
+ __name__ = "RemixshareCom"
+ __type__ = "hoster"
+ __version__ = "0.01"
+
+ __pattern__ = r'https?://remixshare\.com/(download|dl)/\w+'
+
+ __description__ = """Remixshare.com hoster plugin"""
+ __author_name__ = ("zapp-brannigan", "Walter Purcaro")
+ __author_mail__ = ("fuerst.reinje@web.de", "vuolter@gmail.com")
+
+ FILE_INFO_PATTERN = r'title=\'.+?\'>(?P<N>.+?)</span><span class=\'light2\'>&nbsp;\((?P<S>\d+)&nbsp;(?P<U>\w+)\)<'
+ OFFLINE_PATTERN = r'<h1>Ooops!<'
+
+ LINK_PATTERN = r'(http://remixshare\.com/downloadfinal/.+?)"'
+ TOKEN_PATTERN = r'var acc = (\d+)'
+ WAIT_PATTERN = r'var XYZ = r"(\d+)"'
+
+
+ def setup(self):
+ self.multiDL = True
+ self.chunkLimit = 1
+
+ def handleFree(self):
+ b = re.search(self.LINK_PATTERN, self.html)
+ if not b:
+ self.parseError("Cannot parse download url")
+ c = re.search(self.TOKEN_PATTERN, self.html)
+ if not c:
+ self.parseError("Cannot parse file token")
+ dl_url = b.group(1) + c.group(1)
+
+ #Check if we have to wait
+ seconds = re.search(self.WAIT_PATTERN, self.html)
+ if seconds:
+ self.logDebug("Wait " + seconds.group(1))
+ self.wait(seconds.group(1))
+
+ # Finally start downloading...
+ self.logDebug("Download URL = r" + dl_url)
+ self.download(dl_url, disposition=True)
+
+
+getInfo = create_getInfo(RemixshareCom)
diff --git a/module/plugins/hoster/RgHostNet.py b/module/plugins/hoster/RgHostNet.py
index 9e37ed87b..dccc6e557 100644
--- a/module/plugins/hoster/RgHostNet.py
+++ b/module/plugins/hoster/RgHostNet.py
@@ -1,27 +1,32 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class RgHostNet(SimpleHoster):
__name__ = "RgHostNet"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?rghost\.net/\d+(?:r=\d+)?'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?rghost\.net/\d+(?:r=\d+)?'
+
__description__ = """RgHost.net hoster plugin"""
__author_name__ = "z00nx"
__author_mail__ = "z00nx0@gmail.com"
FILE_INFO_PATTERN = r'<h1>\s+(<a[^>]+>)?(?P<N>[^<]+)(</a>)?\s+<small[^>]+>\s+\((?P<S>[^)]+)\)\s+</small>\s+</h1>'
- FILE_OFFLINE_PATTERN = r'File is deleted|this page is not found'
- DOWNLOAD_LINK_PATTERN = '''<a\s+href="([^"]+)"\s+class="btn\s+large\s+download"[^>]+>Download</a>'''
+ OFFLINE_PATTERN = r'File is deleted|this page is not found'
+ LINK_PATTERN = r'''<a\s+href="([^"]+)"\s+class="btn\s+large\s+download"[^>]+>Download</a>'''
+
def handleFree(self):
- found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if not found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError("Unable to detect the direct link")
- download_link = found.group(1)
+ download_link = m.group(1)
self.download(download_link, disposition=True)
+
getInfo = create_getInfo(RgHostNet)
diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py
index 4d3e9b7f3..a24090cde 100644
--- a/module/plugins/hoster/RyushareCom.py
+++ b/module/plugins/hoster/RyushareCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-
-# Test links (random.bin):
+#
+# Test links:
# http://ryushare.com/cl0jy8ric2js/random.bin
import re
@@ -12,8 +12,10 @@ from module.plugins.internal.CaptchaService import SolveMedia
class RyushareCom(XFileSharingPro):
__name__ = "RyushareCom"
__type__ = "hoster"
+ __version__ = "0.16"
+
__pattern__ = r'http://(?:www\.)?ryushare\.com/\w+'
- __version__ = "0.15"
+
__description__ = """Ryushare.com hoster plugin"""
__author_name__ = ("zoidberg", "stickell", "quareevo")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "quareevo@arcor.de")
@@ -23,15 +25,16 @@ class RyushareCom(XFileSharingPro):
FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[\d\.]+) (?P<U>\w+)'
WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]'
- DIRECT_LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)'
+ LINK_PATTERN = r'<a href="([^"]+)">Click here to download<'
SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"'
+
def getDownloadLink(self):
retry = False
self.html = self.load(self.pyfile.url)
action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")})
if "method_premium" in inputs:
- del inputs["method_premium"]
+ del inputs['method_premium']
self.html = self.load(self.pyfile.url, post=inputs)
action, inputs = self.parseHtmlForm('F1')
@@ -42,10 +45,10 @@ class RyushareCom(XFileSharingPro):
self.setWait(1 * 60 * 60, True)
retry = True
- match = re.search(self.WAIT_PATTERN, self.html)
- if match:
- m = match.groupdict(0)
- waittime = int(m["hour"]) * 60 * 60 + int(m["min"]) * 60 + int(m["sec"])
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ wait = m.groupdict(0)
+ waittime = int(wait['hour']) * 60 * 60 + int(wait['min']) * 60 + int(wait['sec'])
self.setWait(waittime, True)
retry = True
@@ -55,15 +58,15 @@ class RyushareCom(XFileSharingPro):
for _ in xrange(5):
m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
- if not m:
+ if m is None:
self.parseError("Error parsing captcha")
captchaKey = m.group(1)
captcha = SolveMedia(self)
challenge, response = captcha.challenge(captchaKey)
- inputs["adcopy_challenge"] = challenge
- inputs["adcopy_response"] = response
+ inputs['adcopy_challenge'] = challenge
+ inputs['adcopy_response'] = response
self.html = self.load(self.pyfile.url, post=inputs)
if "WRONG CAPTCHA" in self.html:
@@ -76,8 +79,7 @@ class RyushareCom(XFileSharingPro):
self.fail("You have entered 5 invalid captcha codes")
if "Click here to download" in self.html:
- m = re.search(r'<a href="([^"]+)">Click here to download</a>', self.html)
- return m.group(1)
+ return re.search(r'<a href="([^"]+)">Click here to download</a>', self.html).group(1)
getInfo = create_getInfo(RyushareCom)
diff --git a/module/plugins/hoster/SecureUploadEu.py b/module/plugins/hoster/SecureUploadEu.py
index 1b11d691d..3691be7da 100644
--- a/module/plugins/hoster/SecureUploadEu.py
+++ b/module/plugins/hoster/SecureUploadEu.py
@@ -6,16 +6,18 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class SecureUploadEu(XFileSharingPro):
__name__ = "SecureUploadEu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?secureupload\.eu/(\w){12}(/\w+)'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?secureupload\.eu/(\w){12}(/\w+)'
+
__description__ = """SecureUpload.eu hoster plugin"""
__author_name__ = "z00nx"
__author_mail__ = "z00nx0@gmail.com"
HOSTER_NAME = "secureupload.eu"
- FILE_INFO_PATTERN = '<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>'
- FILE_OFFLINE_PATTERN = 'The file was removed|File Not Found'
+ FILE_INFO_PATTERN = r'<h3>Downloading (?P<N>[^<]+) \((?P<S>[^<]+)\)</h3>'
+ OFFLINE_PATTERN = r'The file was removed|File Not Found'
getInfo = create_getInfo(SecureUploadEu)
diff --git a/module/plugins/hoster/SendmywayCom.py b/module/plugins/hoster/SendmywayCom.py
index 6de87e2b3..f5e9e9ca6 100644
--- a/module/plugins/hoster/SendmywayCom.py
+++ b/module/plugins/hoster/SendmywayCom.py
@@ -6,8 +6,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class SendmywayCom(XFileSharingPro):
__name__ = "SendmywayCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?sendmyway.com/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?sendmyway.com/\w{12}'
+
__description__ = """SendMyWay hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py
index d6eafac0c..1dac231eb 100644
--- a/module/plugins/hoster/SendspaceCom.py
+++ b/module/plugins/hoster/SendspaceCom.py
@@ -1,60 +1,48 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class SendspaceCom(SimpleHoster):
__name__ = "SendspaceCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?sendspace.com/file/.*'
__version__ = "0.13"
+
+ __pattern__ = r'http://(?:www\.)?sendspace.com/file/.*'
+
__description__ = """Sendspace.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- DOWNLOAD_URL_PATTERN = r'<a id="download_button" href="([^"]+)"'
FILE_NAME_PATTERN = r'<h2 class="bgray">\s*<(?:b|strong)>(?P<N>[^<]+)</'
FILE_SIZE_PATTERN = r'<div class="file_description reverse margin_center">\s*<b>File Size:</b>\s*(?P<S>[0-9.]+)(?P<U>[kKMG])i?B\s*</div>'
- FILE_OFFLINE_PATTERN = r'<div class="msg error" style="cursor: default">Sorry, the file you requested is not available.</div>'
+ OFFLINE_PATTERN = r'<div class="msg error" style="cursor: default">Sorry, the file you requested is not available.</div>'
+
+ LINK_PATTERN = r'<a id="download_button" href="([^"]+)"'
CAPTCHA_PATTERN = r'<td><img src="(/captchas/captcha.php?captcha=([^"]+))"></td>'
USER_CAPTCHA_PATTERN = r'<td><img src="/captchas/captcha.php?user=([^"]+))"></td>'
+
def handleFree(self):
params = {}
for _ in xrange(3):
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m:
if 'captcha_hash' in params:
self.correctCaptcha()
- download_url = found.group(1)
+ download_url = m.group(1)
break
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if found:
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m:
if 'captcha_hash' in params:
self.invalidCaptcha()
- captcha_url1 = "http://www.sendspace.com/" + found.group(1)
- found = re.search(self.USER_CAPTCHA_PATTERN, self.html)
- captcha_url2 = "http://www.sendspace.com/" + found.group(1)
- params = {'captcha_hash': found.group(2),
+ captcha_url1 = "http://www.sendspace.com/" + m.group(1)
+ m = re.search(self.USER_CAPTCHA_PATTERN, self.html)
+ captcha_url2 = "http://www.sendspace.com/" + m.group(1)
+ params = {'captcha_hash': m.group(2),
'captcha_submit': 'Verify',
'captcha_answer': self.decryptCaptcha(captcha_url1) + " " + self.decryptCaptcha(captcha_url2)}
else:
diff --git a/module/plugins/hoster/Share4webCom.py b/module/plugins/hoster/Share4webCom.py
index e25216cb8..e5221baa9 100644
--- a/module/plugins/hoster/Share4webCom.py
+++ b/module/plugins/hoster/Share4webCom.py
@@ -7,13 +7,15 @@ from module.plugins.internal.SimpleHoster import create_getInfo
class Share4webCom(UnibytesCom):
__name__ = "Share4webCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?share4web\.com/get/\w+'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?share4web\.com/get/\w+'
+
__description__ = """Share4web.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- DOMAIN = 'http://www.share4web.com'
+ HOSTER_NAME = "share4web.com"
getInfo = create_getInfo(UnibytesCom)
diff --git a/module/plugins/hoster/Share76Com.py b/module/plugins/hoster/Share76Com.py
index 558ec2451..2c5dd877d 100644
--- a/module/plugins/hoster/Share76Com.py
+++ b/module/plugins/hoster/Share76Com.py
@@ -6,11 +6,13 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class Share76Com(DeadHoster):
__name__ = "Share76Com"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?share76.com/\w{12}'
__version__ = "0.04"
+
+ __pattern__ = r'http://(?:www\.)?share76.com/\w{12}'
+
__description__ = """Share76.com hoster plugin"""
__author_name__ = "me"
- __author_mail__ = ""
+ __author_mail__ = None
getInfo = create_getInfo(Share76Com)
diff --git a/module/plugins/hoster/ShareFilesCo.py b/module/plugins/hoster/ShareFilesCo.py
index 35f21916c..54ae7777a 100644
--- a/module/plugins/hoster/ShareFilesCo.py
+++ b/module/plugins/hoster/ShareFilesCo.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class ShareFilesCo(DeadHoster):
__name__ = "ShareFilesCo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?sharefiles\.co/\w{12}'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?sharefiles\.co/\w{12}'
+
__description__ = """Sharefiles.co hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py
index b82a142ea..414e92feb 100644
--- a/module/plugins/hoster/ShareRapidCom.py
+++ b/module/plugins/hoster/ShareRapidCom.py
@@ -3,9 +3,9 @@
import re
from pycurl import HTTPHEADER
-from module.network.HTTPRequest import BadHeader
+
from module.network.RequestFactory import getRequest
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo, replace_patterns
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
def getInfo(urls):
@@ -15,50 +15,46 @@ def getInfo(urls):
"User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"])
for url in urls:
html = h.load(url, decode=True)
- file_info = parseFileInfo(ShareRapidCom, replace_patterns(url, ShareRapidCom.FILE_URL_REPLACEMENTS), html)
+ file_info = parseFileInfo(ShareRapidCom, url, html)
yield file_info
class ShareRapidCom(SimpleHoster):
__name__ = "ShareRapidCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/stahuj/(?P<id>\w+)'
- __version__ = "0.53"
- __description__ = """Share-rapid.com hoster plugin"""
- __author_name__ = ("MikyWoW", "zoidberg", "stickell")
- __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+ __version__ = "0.54"
+
+ __pattern__ = r'http://(?:www\.)?(share|mega)rapid\.cz/soubor/\d+/.+'
+
+ __description__ = """MegaRapid.cz hoster plugin"""
+ __author_name__ = ("MikyWoW", "zoidberg", "stickell", "Walter Purcaro")
+ __author_mail__ = ("mikywow@seznam.cz", "zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com")
FILE_NAME_PATTERN = r'<h1[^>]*><span[^>]*>(?:<a[^>]*>)?(?P<N>[^<]+)'
FILE_SIZE_PATTERN = r'<td class="i">Velikost:</td>\s*<td class="h"><strong>\s*(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong></td>'
- FILE_OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán'
+ OFFLINE_PATTERN = ur'Nastala chyba 404|Soubor byl smazán'
+
+ SH_CHECK_TRAFFIC = True
- DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" title="Stahnout">([^<]+)</a>'
+ LINK_PATTERN = r'<a href="([^"]+)" title="Stahnout">([^<]+)</a>'
ERR_LOGIN_PATTERN = ur'<div class="error_div"><strong>Stahování je přístupné pouze přihlášenÃœm uÅŸivatelům'
ERR_CREDIT_PATTERN = ur'<div class="error_div"><strong>Stahování zdarma je moÅŸné jen přes náš'
- FILE_URL_REPLACEMENTS = [(__pattern__, r'http://share-rapid.com/stahuj/\g<id>')]
def setup(self):
self.chunkLimit = 1
- self.resumeDownload = True
-
- def process(self, pyfile):
- if not self.account:
- self.fail("User not logged in")
+ def handlePremium(self):
try:
- self.html = self.load(pyfile.url, decode=True)
+ self.html = self.load(self.pyfile.url, decode=True)
except BadHeader, e:
self.account.relogin(self.user)
self.retry(max_tries=3, reason=str(e))
- self.getFileInfo()
-
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if found:
- link = found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m:
+ link = m.group(1)
self.logDebug("Premium link: %s" % link)
-
self.download(link, disposition=True)
else:
if re.search(self.ERR_LOGIN_PATTERN, self.html):
diff --git a/module/plugins/hoster/SharebeesCom.py b/module/plugins/hoster/SharebeesCom.py
index a4625b6a1..d5b4a3bbc 100644
--- a/module/plugins/hoster/SharebeesCom.py
+++ b/module/plugins/hoster/SharebeesCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class SharebeesCom(DeadHoster):
__name__ = "SharebeesCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?sharebees.com/\w{12}'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?sharebees.com/\w{12}'
+
__description__ = """ShareBees hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index a5bd9c250..feaa95603 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
import re
+
from time import time
-from module.plugins.Hoster import Hoster
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
from module.plugins.internal.CaptchaService import ReCaptcha
@@ -38,14 +39,17 @@ def getInfo(urls):
class ShareonlineBiz(Hoster):
__name__ = "ShareonlineBiz"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download.php\?id=|dl/)(?P<ID>\w+)'
__version__ = "0.40"
+
+ __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download.php\?id=|dl/)(?P<ID>\w+)'
+
__description__ = """Shareonline.biz hoster plugin"""
__author_name__ = ("spoob", "mkaay", "zoidberg", "Walter Purcaro")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz", "vuolter@gmail.com")
ERROR_INFO_PATTERN = r'<p class="b">Information:</p>\s*<div>\s*<strong>(.*?)</strong>'
+
def setup(self):
# range request not working?
# api supports resume, only one chunk
@@ -84,17 +88,17 @@ class ShareonlineBiz(Hoster):
fields = src.split(";")
self.api_data = {"fileid": fields[0],
"status": fields[1]}
- if not self.api_data["status"] == "OK":
+ if not self.api_data['status'] == "OK":
self.offline()
else:
- self.api_data["filename"] = fields[2]
- self.api_data["size"] = fields[3] # in bytes
- self.api_data["md5"] = fields[4].strip().lower().replace("\n\n", "") # md5
+ self.api_data['filename'] = fields[2]
+ self.api_data['size'] = fields[3] # in bytes
+ self.api_data['md5'] = fields[4].strip().lower().replace("\n\n", "") # md5
def handleFree(self):
self.loadAPIData()
- self.pyfile.name = self.api_data["filename"]
- self.pyfile.size = int(self.api_data["size"])
+ self.pyfile.name = self.api_data['filename']
+ self.pyfile.size = int(self.api_data['size'])
self.html = self.load(self.pyfile.url, cookies=True) # refer, stuff
self.setWait(3)
@@ -103,12 +107,12 @@ class ShareonlineBiz(Hoster):
self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free": "1", "choice": "free"}, decode=True)
self.checkErrors()
- found = re.search(r'var wait=(\d+);', self.html)
+ m = re.search(r'var wait=(\d+);', self.html)
recaptcha = ReCaptcha(self)
for _ in xrange(5):
challenge, response = recaptcha.challenge("6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX")
- self.setWait(int(found.group(1)) if found else 30)
+ self.setWait(int(m.group(1)) if m else 30)
response = self.load("%s/free/captcha/%d" % (self.pyfile.url, int(time() * 1000)), post={
'dl_free': '1',
'recaptcha_challenge_field': challenge,
@@ -144,10 +148,10 @@ class ShareonlineBiz(Hoster):
else:
self.correctCaptcha()
- def handlePremium(self): # should be working better loading (account) api internally
+ def handlePremium(self): #: should be working better loading (account) api internally
self.account.getAccountInfo(self.user, True)
src = self.load("http://api.share-online.biz/account.php",
- {"username": self.user, "password": self.account.accounts[self.user]["password"],
+ {"username": self.user, "password": self.account.accounts[self.user]['password'],
"act": "download", "lid": self.file_id})
self.api_data = dlinfo = {}
@@ -156,13 +160,13 @@ class ShareonlineBiz(Hoster):
dlinfo[key.lower()] = value
self.logDebug(dlinfo)
- if not dlinfo["status"] == "online":
+ if not dlinfo['status'] == "online":
self.offline()
else:
- self.pyfile.name = dlinfo["name"]
- self.pyfile.size = int(dlinfo["size"])
+ self.pyfile.name = dlinfo['name']
+ self.pyfile.size = int(dlinfo['size'])
- dlLink = dlinfo["url"]
+ dlLink = dlinfo['url']
if dlLink == "server_under_maintenance":
self.tempOffline()
else:
@@ -170,18 +174,18 @@ class ShareonlineBiz(Hoster):
self.download(dlLink)
def checkErrors(self):
- found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL)
- if not found:
+ m = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL)
+ if m is None:
return
- err = found.group(1)
- found = re.search(self.ERROR_INFO_PATTERN, self.html)
- msg = found.group(1) if found else ""
+ err = m.group(1)
+ m = re.search(self.ERROR_INFO_PATTERN, self.html)
+ msg = m.group(1) if m else ""
self.logError(err, msg or "Unknown error occurred")
- if err in ('invalid'):
+ if err == "invalid":
self.fail(msg or "File not available")
- elif err in ('freelimit', 'size', 'proxy'):
+ elif err in ("freelimit", "size", "proxy"):
self.fail(msg or "Premium account needed")
else:
if err in 'server':
diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py
index ba1b40fb7..0d236fe30 100644
--- a/module/plugins/hoster/ShareplaceCom.py
+++ b/module/plugins/hoster/ShareplaceCom.py
@@ -1,18 +1,23 @@
# -*- coding: utf-8 -*-
import re
-import urllib
+
+from urllib import unquote
+
from module.plugins.Hoster import Hoster
class ShareplaceCom(Hoster):
__name__ = "ShareplaceCom"
__type__ = "hoster"
- __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+'
__version__ = "0.11"
+
+ __pattern__ = r'(http://)?(?:www\.)?shareplace\.(com|org)/\?[a-zA-Z0-9]+'
+
__description__ = """Shareplace.com hoster plugin"""
__author_name__ = "ACCakut"
- __author_mail__ = ""
+ __author_mail__ = None
+
def process(self, pyfile):
self.pyfile = pyfile
@@ -31,7 +36,7 @@ class ShareplaceCom(Hoster):
self.wait()
def get_waiting_time(self):
- if self.html is None:
+ if not self.html:
self.download_html()
#var zzipitime = 15;
@@ -53,7 +58,7 @@ class ShareplaceCom(Hoster):
url = re.search(r"var beer = '(.*?)';", self.html)
if url:
url = url.group(1)
- url = urllib.unquote(
+ url = unquote(
url.replace("http://http:/", "").replace("vvvvvvvvv", "").replace("lllllllll", "").replace(
"teletubbies", ""))
self.logDebug("URL: %s" % url)
@@ -62,7 +67,7 @@ class ShareplaceCom(Hoster):
self.fail("absolute filepath could not be found. offline? ")
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
return re.search("<title>\s*(.*?)\s*</title>", self.html).group(1)
@@ -70,7 +75,7 @@ class ShareplaceCom(Hoster):
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r"HTTP Status 404", self.html) is not None:
diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py
index a86e66972..ba3356d66 100644
--- a/module/plugins/hoster/ShragleCom.py
+++ b/module/plugins/hoster/ShragleCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class ShragleCom(DeadHoster):
__name__ = "ShragleCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(cloudnator|shragle).com/files/(?P<ID>.*?)/'
__version__ = "0.22"
+
+ __pattern__ = r'http://(?:www\.)?(cloudnator|shragle).com/files/(?P<ID>.*?)/'
+
__description__ = """Cloudnator.com (Shragle.com) hoster plugin"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py
index 17060e00d..5db9f5daa 100644
--- a/module/plugins/hoster/SimplyPremiumCom.py
+++ b/module/plugins/hoster/SimplyPremiumCom.py
@@ -1,46 +1,25 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
-
import re
+
from datetime import datetime, timedelta
from module.plugins.Hoster import Hoster
-
-
-def secondsToMidnight():
- # Seconds until 00:10 GMT+2
- now = datetime.utcnow() + timedelta(hours=2)
- if now.hour is 0 and now.minute < 10:
- midnight = now
- else:
- midnight = now + timedelta(days=1)
- midnight = midnight.replace(hour=0, minute=10, second=0, microsecond=0)
- return int((midnight - now).total_seconds())
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
class SimplyPremiumCom(Hoster):
__name__ = "SimplyPremiumCom"
- __version__ = "0.02"
__type__ = "hoster"
- __pattern__ = r"https?://.*(simply-premium)\.com"
- __description__ = """Simply-Premium.Com hoster plugin"""
+ __version__ = "0.03"
+
+ __pattern__ = r'https?://.*(simply-premium)\.com'
+
+ __description__ = """Simply-Premium.com hoster plugin"""
__author_name__ = "EvolutionClip"
__author_mail__ = "evolutionclip@live.de"
+
def setup(self):
self.chunkLimit = 16
self.resumeDownload = False
@@ -69,13 +48,13 @@ class SimplyPremiumCom(Hoster):
elif "NOTFOUND" in page:
self.offline()
elif "downloadlimit" in page:
- self.logInfo("Reached maximum connctions")
+ self.logWarning("Reached maximum connctions")
self.retry(5, 60, "Reached maximum connctions")
elif "trafficlimit" in page:
- self.logInfo("Reached daily limit for this host. Waiting until 00:10 GMT+2")
- self.retry(5, secondsToMidnight(), "Daily limit for this host reached")
+ self.logWarning("Reached daily limit for this host")
+ self.retry(1, secondsToMidnight(gmt=2), "Daily limit for this host reached")
elif "hostererror" in page:
- self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
+ self.logWarning("Hoster temporarily unavailable, waiting 1 minute and retry")
self.retry(5, 60, "Hoster is temporarily unavailable")
#page = json_loads(page)
#new_url = page.keys()[0]
diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py
index 2aab12e04..78f6c0a34 100644
--- a/module/plugins/hoster/SimplydebridCom.py
+++ b/module/plugins/hoster/SimplydebridCom.py
@@ -7,13 +7,16 @@ from module.plugins.Hoster import Hoster
class SimplydebridCom(Hoster):
__name__ = "SimplydebridCom"
- __version__ = "0.1"
__type__ = "hoster"
+ __version__ = "0.1"
+
__pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*'
+
__description__ = """Simply-debrid.com hoster plugin"""
__author_name__ = "Kagenoshin"
__author_mail__ = "kagenoshin@gmx.ch"
+
def setup(self):
self.resumeDownload = self.multiDL = True
self.chunkLimit = 1
diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py
index 017c8a839..90f092473 100644
--- a/module/plugins/hoster/SockshareCom.py
+++ b/module/plugins/hoster/SockshareCom.py
@@ -1,41 +1,31 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
import re
+
from os import rename
+from module.plugins.hoster.UnrestrictLi import secondsToMidnight
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class SockshareCom(SimpleHoster):
__name__ = "SockshareCom"
__type__ = "hoster"
+ __version__ = "0.04"
+
__pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
- __version__ = "0.02"
+
__description__ = """Sockshare.com hoster plugin"""
__author_name__ = ("jeix", "stickell", "Walter Purcaro")
__author_mail__ = ("jeix@hasnomail.de", "l.stickell@yahoo.it", "vuolter@gmail.com")
FILE_INFO_PATTERN = r'site-content">\s*<h1>(?P<N>.+)<strong>\( (?P<S>[^)]+) \)</strong></h1>'
- FILE_OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<'
+ OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<'
+ TEMP_OFFLINE_PATTERN = r'(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)'
FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.com/file/\g<ID>')]
+
def setup(self):
self.multiDL = self.resumeDownload = True
self.chunkLimit = -1
@@ -54,9 +44,11 @@ class SockshareCom(SimpleHoster):
post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"}
self.html = self.load(self.pyfile.url, post=post_data)
- if (">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html or
- "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html):
- self.retry(wait_time=60 * 60 * 2, reason="Download limit exceeded or server disabled") # 2 hours wait
+ if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html:
+ self.logWarning("You have exceeded your daily stream limit for today")
+ self.wait(secondsToMidnight(gmt=2), True)
+ elif re.search(self.TEMP_OFFLINE_PATTERN, self.html):
+ self.retry(wait_time=2 * 60 * 60, reason="Server temporarily offline") # 2 hours wait
patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[a-zA-Z0-9=]+&original=1)',
r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)',
@@ -71,7 +63,7 @@ class SockshareCom(SimpleHoster):
if link:
self.html = self.load("http://www.sockshare.com" + link.group(1))
link = re.search(r'media:content url="(http://.*?)"', self.html)
- if not link:
+ if link is None:
link = re.search(r'\"(http://media\\-b\\d+\\.sockshare\\.com/download/\\d+/.*?)\"', self.html)
else:
self.parseError('Unable to detect a download link')
diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py
index a1ec1378a..05fe897d2 100644
--- a/module/plugins/hoster/SoundcloudCom.py
+++ b/module/plugins/hoster/SoundcloudCom.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-import re
import pycurl
+import re
from module.plugins.Hoster import Hoster
@@ -9,34 +9,37 @@ from module.plugins.Hoster import Hoster
class SoundcloudCom(Hoster):
__name__ = "SoundcloudCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?soundcloud\.com/(?P<UID>.*?)/(?P<SID>.*)'
__version__ = "0.1"
+
+ __pattern__ = r'https?://(?:www\.)?soundcloud\.com/(?P<UID>.*?)/(?P<SID>.*)'
+
__description__ = """SoundCloud.com hoster plugin"""
__author_name__ = "Peekayy"
__author_mail__ = "peekayy.dev@gmail.com"
+
def process(self, pyfile):
# default UserAgent of HTTPRequest fails for this hoster so we use this one
self.req.http.c.setopt(pycurl.USERAGENT, 'Mozilla/5.0')
page = self.load(pyfile.url)
- match = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>[0-9]*)"', page)
+ m = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>[0-9]*)"', page)
songId = clientId = ""
- if match:
- songId = match.group("ID")
+ if m:
+ songId = m.group("ID")
if len(songId) <= 0:
self.logError("Could not find song id")
self.offline()
else:
- match = re.search(r'"clientID":"(?P<CID>.*?)"', page)
- if match:
- clientId = match.group("CID")
+ m = re.search(r'"clientID":"(?P<CID>.*?)"', page)
+ if m:
+ clientId = m.group("CID")
if len(clientId) <= 0:
clientId = "b45b1aa10f1ac2941910a7f0d10f8e28"
- match = re.search(r'<em itemprop="name">\s(?P<TITLE>.*?)\s</em>', page)
- if match:
- pyfile.name = match.group("TITLE") + ".mp3"
+ m = re.search(r'<em itemprop="name">\s(?P<TITLE>.*?)\s</em>', page)
+ if m:
+ pyfile.name = m.group("TITLE") + ".mp3"
else:
pyfile.name = re.match(self.__pattern__, pyfile.url).group("SID") + ".mp3"
diff --git a/module/plugins/hoster/SpeedLoadOrg.py b/module/plugins/hoster/SpeedLoadOrg.py
index 76ab52868..8cf1163b2 100644
--- a/module/plugins/hoster/SpeedLoadOrg.py
+++ b/module/plugins/hoster/SpeedLoadOrg.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class SpeedLoadOrg(DeadHoster):
__name__ = "SpeedLoadOrg"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?speedload\.org/(?P<ID>\w+)'
__version__ = "1.02"
+
+ __pattern__ = r'http://(?:www\.)?speedload\.org/(?P<ID>\w+)'
+
__description__ = """Speedload.org hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
diff --git a/module/plugins/hoster/SpeedfileCz.py b/module/plugins/hoster/SpeedfileCz.py
index 63e126f0a..6a42d1dbe 100644
--- a/module/plugins/hoster/SpeedfileCz.py
+++ b/module/plugins/hoster/SpeedfileCz.py
@@ -1,30 +1,15 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class SpeedfileCz(DeadHoster):
__name__ = "SpeedFileCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?speedfile.cz/.*'
__version__ = "0.32"
+
+ __pattern__ = r'http://(?:www\.)?speedfile.cz/.*'
+
__description__ = """Speedfile.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/SpeedyshareCom.py b/module/plugins/hoster/SpeedyshareCom.py
new file mode 100644
index 000000000..22f4ee511
--- /dev/null
+++ b/module/plugins/hoster/SpeedyshareCom.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+# Testlink:
+# http://speedy.sh/ep2qY/Zapp-Brannigan.jpg
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class SpeedyshareCom(SimpleHoster):
+ __name__ = "SpeedyshareCom"
+ __type__ = "hoster"
+ __pattern__ = r"https?://(www\.)?(speedyshare.com|speedy.sh)/.*"
+ __version__ = "0.01"
+ __description__ = """speedyshare.com hoster plugin"""
+ __author_name__ = ("zapp-brannigan")
+ __author_mail__ = ("fuerst.reinje@web.de")
+
+ FILE_NAME_PATTERN = r'class=downloadfilename>(?P<N>.*)</span></td>'
+ FILE_SIZE_PATTERN = r'class=sizetagtext>(?P<S>.*) (?P<U>[kKmM]?[iI]?[bB]?)</div>'
+ LINK_PATTERN = r'<a href=\'(.*)\'><img src=/gf/slowdownload.png alt=\'Slow Download\' border=0'
+ FILE_OFFLINE_PATTERN = r'class=downloadfilenamenotfound>.*</span>'
+ BASE_URL = 'www.speedyshare.com'
+
+ def setup(self):
+ self.multiDL = False
+ self.chunkLimit = 1
+
+ def process(self, pyfile):
+ self.html = self.load(pyfile.url, decode=True)
+ try:
+ dl_link = re.search(self.LINK_PATTERN, self.html).group(1)
+ self.logDebug("Link: " + dl_link)
+ except:
+ self.parseError("Unable to find download link")
+ self.download(self.BASE_URL + dl_link, disposition=True)
+ check = self.checkDownload({"is_html": re.compile("html")})
+ if check == "is_html":
+ self.fail("The downloaded file is html, maybe the plugin is out of date")
+
+
+getInfo = create_getInfo(SpeedyshareCom)
diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py
index bbef31a67..526e61eea 100644
--- a/module/plugins/hoster/StreamCz.py
+++ b/module/plugins/hoster/StreamCz.py
@@ -1,25 +1,9 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.Hoster import Hoster
+
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
def getInfo(urls):
@@ -28,7 +12,7 @@ def getInfo(urls):
for url in urls:
html = getURL(url)
- if re.search(StreamCz.FILE_OFFLINE_PATTERN, html):
+ if re.search(StreamCz.OFFLINE_PATTERN, html):
# File offline
result.append((url, 0, 1, url))
else:
@@ -39,16 +23,20 @@ def getInfo(urls):
class StreamCz(Hoster):
__name__ = "StreamCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?stream.cz/[^/]+/\d+.*'
- __version__ = "0.1"
+ __version__ = "0.2"
+
+ __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*'
+
__description__ = """Stream.cz hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- FILE_OFFLINE_PATTERN = r'<h1 class="commonTitle">Str.nku nebylo mo.n. nal.zt \(404\)</h1>'
FILE_NAME_PATTERN = r'<link rel="video_src" href="http://www.stream.cz/\w+/(\d+)-([^"]+)" />'
+ OFFLINE_PATTERN = r'<h1 class="commonTitle">Str.nku nebylo mo.n. nal.zt \(404\)</h1>'
+
CDN_PATTERN = r'<param name="flashvars" value="[^"]*&id=(?P<ID>\d+)(?:&cdnLQ=(?P<cdnLQ>\d*))?(?:&cdnHQ=(?P<cdnHQ>\d*))?(?:&cdnHD=(?P<cdnHD>\d*))?&'
+
def setup(self):
self.multiDL = True
self.resumeDownload = True
@@ -57,13 +45,13 @@ class StreamCz(Hoster):
self.html = self.load(pyfile.url, decode=True)
- if re.search(self.FILE_OFFLINE_PATTERN, self.html):
+ if re.search(self.OFFLINE_PATTERN, self.html):
self.offline()
- found = re.search(self.CDN_PATTERN, self.html)
- if found is None:
+ m = re.search(self.CDN_PATTERN, self.html)
+ if m is None:
self.fail("Parse error (CDN)")
- cdn = found.groupdict()
+ cdn = m.groupdict()
self.logDebug(cdn)
for cdnkey in ("cdnHD", "cdnHQ", "cdnLQ"):
if cdnkey in cdn and cdn[cdnkey] > '':
@@ -72,10 +60,10 @@ class StreamCz(Hoster):
else:
self.fail("Stream URL not found")
- found = re.search(self.FILE_NAME_PATTERN, self.html)
- if found is None:
+ m = re.search(self.FILE_NAME_PATTERN, self.html)
+ if m is None:
self.fail("Parse error (NAME)")
- pyfile.name = "%s-%s.%s.mp4" % (found.group(2), found.group(1), cdnkey[-2:])
+ pyfile.name = "%s-%s.%s.mp4" % (m.group(2), m.group(1), cdnkey[-2:])
download_url = "http://cdn-dispatcher.stream.cz/?id=" + cdnid
self.logInfo("STREAM (%s): %s" % (cdnkey[-2:], download_url))
diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py
index 388eb7876..11333640e 100644
--- a/module/plugins/hoster/StreamcloudEu.py
+++ b/module/plugins/hoster/StreamcloudEu.py
@@ -1,33 +1,37 @@
# -*- coding: utf-8 -*-
-from time import sleep
import re
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+from time import sleep
+
from module.network.HTTPRequest import HTTPRequest
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
class StreamcloudEu(XFileSharingPro):
__name__ = "StreamcloudEu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+'
__version__ = "0.04"
+
+ __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+'
+
__description__ = """Streamcloud.eu hoster plugin"""
__author_name__ = "seoester"
__author_mail__ = "seoester@googlemail.com"
HOSTER_NAME = "streamcloud.eu"
- DIRECT_LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",'
+ LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",'
+
def setup(self):
super(StreamcloudEu, self).setup()
self.multiDL = True
def getDownloadLink(self):
- found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
- return found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html, re.S)
+ if m:
+ return m.group(1)
for i in xrange(5):
self.logDebug("Getting download link: #%d" % i)
@@ -38,12 +42,12 @@ class StreamcloudEu(XFileSharingPro):
self.html = httpRequest.load(self.pyfile.url, post=data, referer=False, cookies=True, decode=True)
self.header = httpRequest.header
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if found:
+ m = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ if m:
break
- found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
+ m = re.search(self.LINK_PATTERN, self.html, re.S)
+ if m:
break
else:
@@ -52,7 +56,7 @@ class StreamcloudEu(XFileSharingPro):
else:
self.fail("Download link not found")
- return found.group(1)
+ return m.group(1)
def getPostParameters(self):
for i in xrange(3):
@@ -74,7 +78,7 @@ class StreamcloudEu(XFileSharingPro):
self.logDebug(self.HOSTER_NAME, inputs)
- if 'op' in inputs and inputs['op'] in ('download1', 'download2', 'download3'):
+ if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"):
if "password" in inputs:
if self.passwords:
inputs['password'] = self.passwords.pop(0)
@@ -82,9 +86,9 @@ class StreamcloudEu(XFileSharingPro):
self.fail("No or invalid passport")
if not self.premium:
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- wait_time = int(found.group(1)) + 1
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ wait_time = int(m.group(1)) + 1
self.setWait(wait_time, False)
else:
wait_time = 0
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index f15b8b0c4..a9cc46614 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -1,60 +1,44 @@
# -*- coding: utf-8 -*-
-"""
- Copyright (C) 2012 pyLoad team
- 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/>.
-
- @author: zoidberg
-"""
-
-import re
import random
-from urllib import quote
-from binascii import hexlify, unhexlify
+import re
import time
-from pycurl import HTTPHEADER
from Crypto.Cipher import ARC4
+from binascii import hexlify, unhexlify
+from pycurl import HTTPHEADER
+from urllib import quote
+
from module.network.RequestFactory import getURL
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
class TurbobitNet(SimpleHoster):
__name__ = "TurbobitNet"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P<ID>\w+).*'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?(turbobit.net|unextfiles.com)/(?!download/folder/)(?:download/free/)?(?P<ID>\w+).*'
+
__description__ = """Turbobit.net plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- # long filenames are shortened
- FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>"
- FILE_NAME_PATTERN = r'<meta name="keywords" content="\s+(?P<N>[^,]+)' # full name but missing on page2
- FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found'
+ FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" #: long filenames are shortened
+ FILE_NAME_PATTERN = r'<meta name="keywords" content="\s+(?P<N>[^,]+)' #: full name but missing on page2
+ OFFLINE_PATTERN = r'<h2>File Not Found</h2>|html\(\'File (?:was )?not found'
+
FILE_URL_REPLACEMENTS = [(r"http://(?:www\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*",
"http://turbobit.net/\g<ID>.html")]
- SH_COOKIES = [("turbobit.net", "user_lang", "en")]
+ SH_COOKIES = [(".turbobit.net", "user_lang", "en")]
- CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"'
- DOWNLOAD_URL_PATTERN = r'(?P<url>/download/redirect/[^"\']+)'
+ LINK_PATTERN = r'(?P<url>/download/redirect/[^"\']+)'
LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>'
+ CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"'
CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"'
+
def handleFree(self):
self.url = "http://turbobit.net/download/free/%s" % self.file_info['ID']
self.html = self.load(self.url)
@@ -72,9 +56,9 @@ class TurbobitNet(SimpleHoster):
def solveCaptcha(self):
for _ in xrange(5):
- found = re.search(self.LIMIT_WAIT_PATTERN, self.html)
- if found:
- wait_time = int(found.group(1))
+ m = re.search(self.LIMIT_WAIT_PATTERN, self.html)
+ if m:
+ wait_time = int(m.group(1))
self.wait(wait_time, wait_time > 60)
self.retry()
@@ -85,15 +69,15 @@ class TurbobitNet(SimpleHoster):
if inputs['captcha_type'] == 'recaptcha':
recaptcha = ReCaptcha(self)
- found = re.search(self.CAPTCHA_KEY_PATTERN, self.html)
- captcha_key = found.group(1) if found else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c'
+ m = re.search(self.CAPTCHA_KEY_PATTERN, self.html)
+ captcha_key = m.group(1) if m else '6LcTGLoSAAAAAHCWY9TTIrQfjUlxu6kZlTYP50_c'
inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(
captcha_key)
else:
- found = re.search(self.CAPTCHA_SRC_PATTERN, self.html)
- if not found:
+ m = re.search(self.CAPTCHA_SRC_PATTERN, self.html)
+ if m is None:
self.parseError('captcha')
- captcha_url = found.group(1)
+ captcha_url = m.group(1)
inputs['captcha_response'] = self.decryptCaptcha(captcha_url)
self.logDebug(inputs)
@@ -115,7 +99,7 @@ class TurbobitNet(SimpleHoster):
# that's right, we are even using jdownloader updates
rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js")
rtUpdate = self.decrypt(rtUpdate.splitlines()[1])
- # but we still need to fix the syntax to work with other engines than rhino
+ # but we still need to fix the syntax to work with other engines than rhino
rtUpdate = re.sub(r'for each\(var (\w+) in(\[[^\]]+\])\)\{',
r'zza=\2;for(var zzi=0;zzi<zza.length;zzi++){\1=zza[zzi];', rtUpdate)
rtUpdate = re.sub(r"for\((\w+)=", r"for(var \1=", rtUpdate)
@@ -133,8 +117,8 @@ class TurbobitNet(SimpleHoster):
def getDownloadUrl(self, rtUpdate):
self.req.http.lastURL = self.url
- found = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html)
- url = "http://turbobit.net%s%s" % (found.groups() if found else (
+ m = re.search("(/\w+/timeout\.js\?\w+=)([^\"\'<>]+)", self.html)
+ url = "http://turbobit.net%s%s" % (m.groups() if m else (
'/files/timeout.js?ver=', ''.join(random.choice('0123456789ABCDEF') for _ in xrange(32))))
fun = self.load(url)
@@ -172,10 +156,10 @@ class TurbobitNet(SimpleHoster):
self.downloadFile()
def downloadFile(self):
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if not found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError("download link")
- self.url = "http://turbobit.net" + found.group('url')
+ self.url = "http://turbobit.net" + m.group('url')
self.logDebug(self.url)
self.download(self.url)
diff --git a/module/plugins/hoster/TurbouploadCom.py b/module/plugins/hoster/TurbouploadCom.py
index 3f3deca15..bcfa2d7d4 100644
--- a/module/plugins/hoster/TurbouploadCom.py
+++ b/module/plugins/hoster/TurbouploadCom.py
@@ -1,30 +1,15 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class TurbouploadCom(DeadHoster):
__name__ = "TurbouploadCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?turboupload.com/(\w+).*'
__version__ = "0.03"
+
+ __pattern__ = r'http://(?:www\.)?turboupload.com/(\w+).*'
+
__description__ = """Turboupload.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py
index c31b88f20..7fb2a375e 100644
--- a/module/plugins/hoster/TusfilesNet.py
+++ b/module/plugins/hoster/TusfilesNet.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-###############################################################################
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -20,8 +6,10 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class TusfilesNet(XFileSharingPro):
__name__ = "TusfilesNet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?tusfiles\.net/(?P<ID>\w+)'
__version__ = "0.03"
+
+ __pattern__ = r'https?://(?:www\.)?tusfiles\.net/(?P<ID>\w+)'
+
__description__ = """Tusfiles.net hoster plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
@@ -29,10 +17,11 @@ class TusfilesNet(XFileSharingPro):
HOSTER_NAME = "tusfiles.net"
FILE_INFO_PATTERN = r'\](?P<N>.+) - (?P<S>[\d.]+) (?P<U>\w+)\['
- FILE_OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!'
+ OFFLINE_PATTERN = r'>File Not Found|<Title>TusFiles - Fast Sharing Files!'
SH_COOKIES = [(".tusfiles.net", "lang", "english")]
+
def setup(self):
self.multiDL = False
self.chunkLimit = -1
diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py
index 7881ca098..dbd33dd83 100644
--- a/module/plugins/hoster/TwoSharedCom.py
+++ b/module/plugins/hoster/TwoSharedCom.py
@@ -8,25 +8,29 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class TwoSharedCom(SimpleHoster):
__name__ = "TwoSharedCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*'
__version__ = "0.11"
+
+ __pattern__ = r'http://(?:www\.)?2shared.com/(account/)?(download|get|file|document|photo|video|audio)/.*'
+
__description__ = """2Shared.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r'<h1>(?P<N>.*)</h1>'
FILE_SIZE_PATTERN = r'<span class="dtitle">File size:</span>\s*(?P<S>[0-9,.]+) (?P<U>[kKMG])i?B'
- FILE_OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.'
- DOWNLOAD_URL_PATTERN = r"window.location ='([^']+)';"
+ OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.'
+
+ LINK_PATTERN = r"window.location ='([^']+)';"
+
def setup(self):
self.resumeDownload = self.multiDL = True
def handleFree(self):
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if not found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError('Download link')
- link = found.group(1)
+ link = m.group(1)
self.logDebug("Download URL %s" % link)
self.download(link)
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index 282d4605b..dbdaf3f8e 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -1,26 +1,11 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
import time
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
from module.common.json_layer import json_loads
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
def convertDecimalPrefix(m):
# decimal prefixes used in filesize and traffic
@@ -30,16 +15,19 @@ def convertDecimalPrefix(m):
class UlozTo(SimpleHoster):
__name__ = "UlozTo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P<id>\w+/[^/?]*)'
__version__ = "0.98"
+
+ __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P<id>\w+/[^/?]*)'
+
__description__ = """Uloz.to hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+ FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>'
FILE_NAME_PATTERN = r'<title>(?P<N>[^<]+) \| Uloz.to</title>'
FILE_SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[0-9.]+\s[kMG]?B)</span>'
- FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>'
- FILE_OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>'
+ OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>'
+
FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)]
FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")]
@@ -50,6 +38,7 @@ class UlozTo(SimpleHoster):
PREMIUM_URL_PATTERN = r'<div class="downloadForm"><form action="([^"]+)"'
TOKEN_PATTERN = r'<input type="hidden" name="_token_" id="[^\"]*" value="(?P<token>[^\"]*)" />'
+
def setup(self):
self.multiDL = self.premium
self.resumeDownload = True
@@ -61,10 +50,10 @@ class UlozTo(SimpleHoster):
if re.search(self.ADULT_PATTERN, self.html):
self.logInfo("Adult content confirmation needed. Proceeding..")
- found = re.search(self.TOKEN_PATTERN, self.html)
- if not found:
+ m = re.search(self.TOKEN_PATTERN, self.html)
+ if m is None:
self.parseError('TOKEN')
- token = found.group(1)
+ token = m.group(1)
self.html = self.load(pyfile.url, get={"do": "askAgeForm-submit"},
post={"agree": "Confirm", "_token_": token}, cookies=True)
@@ -98,16 +87,16 @@ class UlozTo(SimpleHoster):
self.logDebug('inputs.keys() = ' + str(inputs.keys()))
# get and decrypt captcha
- if all(key in inputs for key in ('captcha_value', 'captcha_id', 'captcha_key')):
+ if all(key in inputs for key in ("captcha_value", "captcha_id", "captcha_key")):
# Old version - last seen 9.12.2013
self.logDebug('Using "old" version')
captcha_value = self.decryptCaptcha("http://img.uloz.to/captcha/%s.png" % inputs['captcha_id'])
- self.logDebug('CAPTCHA ID: ' + inputs['captcha_id'] + ', CAPTCHA VALUE: ' + captcha_value)
+ self.logDebug('CAPTCHA ID: ' + inputs['captcha_id'] + ", CAPTCHA VALUE: " + captcha_value)
inputs.update({'captcha_id': inputs['captcha_id'], 'captcha_key': inputs['captcha_key'], 'captcha_value': captcha_value})
- elif all(key in inputs for key in ('captcha_value', 'timestamp', 'salt', 'hash')):
+ elif all(key in inputs for key in ("captcha_value", "timestamp", "salt", "hash")):
# New version - better to get new parameters (like captcha reload) because of image url - since 6.12.2013
self.logDebug('Using "new" version')
@@ -116,7 +105,7 @@ class UlozTo(SimpleHoster):
data = json_loads(xapca)
captcha_value = self.decryptCaptcha(str(data['image']))
- self.logDebug('CAPTCHA HASH: ' + data['hash'] + ', CAPTCHA SALT: ' + str(data['salt']) + ', CAPTCHA VALUE: ' + captcha_value)
+ self.logDebug("CAPTCHA HASH: " + data['hash'] + ", CAPTCHA SALT: " + str(data['salt']) + ", CAPTCHA VALUE: " + captcha_value)
inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value})
else:
@@ -132,17 +121,17 @@ class UlozTo(SimpleHoster):
def findDownloadURL(self, premium=False):
msg = "%s link" % ("Premium" if premium else "Free")
- found = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html)
- if not found:
+ m = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html)
+ if m is None:
self.parseError(msg)
- parsed_url = "http://www.ulozto.net" + found.group(1)
+ parsed_url = "http://www.ulozto.net" + m.group(1)
self.logDebug("%s: %s" % (msg, parsed_url))
return parsed_url
def doCheckDownload(self):
check = self.checkDownload({
"wrong_captcha": re.compile(r'<ul class="error">\s*<li>Error rewriting the text.</li>'),
- "offline": re.compile(self.FILE_OFFLINE_PATTERN),
+ "offline": re.compile(self.OFFLINE_PATTERN),
"passwd": self.PASSWD_PATTERN,
"server_error": 'src="http://img.ulozto.cz/error403/vykricnik.jpg"', # paralell dl, server overload etc.
"not_found": "<title>UloÅŸ.to</title>"
diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py
index d24e21779..ac70f42d4 100644
--- a/module/plugins/hoster/UloziskoSk.py
+++ b/module/plugins/hoster/UloziskoSk.py
@@ -1,71 +1,59 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UloziskoSk(SimpleHoster):
__name__ = "UloziskoSk"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?ulozisko.sk/.*'
__version__ = "0.23"
+
+ __pattern__ = r'http://(?:www\.)?ulozisko.sk/.*'
+
__description__ = """Ulozisko.sk hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- URL_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">'
- ID_PATTERN = r'<input type = "hidden" name = "id" value = "([^"]+)" />'
FILE_NAME_PATTERN = r'<div class="down1">(?P<N>[^<]+)</div>'
FILE_SIZE_PATTERN = ur'Veğkosť súboru: <strong>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</strong><br />'
+ OFFLINE_PATTERN = ur'<span class = "red">ZadanÜ súbor neexistuje z jedného z nasledujúcich dÎvodov:</span>'
+
+ LINK_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">'
+ ID_PATTERN = r'<input type = "hidden" name = "id" value = "([^"]+)" />'
CAPTCHA_PATTERN = r'<img src="(/obrazky/obrazky.php\?fid=[^"]+)" alt="" />'
- FILE_OFFLINE_PATTERN = ur'<span class = "red">ZadanÜ súbor neexistuje z jedného z nasledujúcich dÎvodov:</span>'
IMG_PATTERN = ur'<strong>PRE ZVÄČŠENIE KLIKNITE NA OBRÁZOK</strong><br /><a href = "([^"]+)">'
+
def process(self, pyfile):
self.html = self.load(pyfile.url, decode=True)
self.getFileInfo()
- found = re.search(self.IMG_PATTERN, self.html)
- if found:
- url = "http://ulozisko.sk" + found.group(1)
+ m = re.search(self.IMG_PATTERN, self.html)
+ if m:
+ url = "http://ulozisko.sk" + m.group(1)
self.download(url)
else:
self.handleFree()
def handleFree(self):
- found = re.search(self.URL_PATTERN, self.html)
- if found is None:
- raise PluginParseError('URL')
- parsed_url = 'http://www.ulozisko.sk' + found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
+ self.parseError('URL')
+ parsed_url = 'http://www.ulozisko.sk' + m.group(1)
- found = re.search(self.ID_PATTERN, self.html)
- if found is None:
- raise PluginParseError('ID')
- id = found.group(1)
+ m = re.search(self.ID_PATTERN, self.html)
+ if m is None:
+ self.parseError('ID')
+ id = m.group(1)
self.logDebug('URL:' + parsed_url + ' ID:' + id)
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if found is None:
- raise PluginParseError('CAPTCHA')
- captcha_url = 'http://www.ulozisko.sk' + found.group(1)
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m is None:
+ self.parseError('CAPTCHA')
+ captcha_url = 'http://www.ulozisko.sk' + m.group(1)
captcha = self.decryptCaptcha(captcha_url, cookies=True)
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index 1a64146c4..e936b84b1 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -1,53 +1,42 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from pycurl import FOLLOWLOCATION
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UnibytesCom(SimpleHoster):
__name__ = "UnibytesCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?unibytes\.com/[a-zA-Z0-9-._ ]{11}B'
__version__ = "0.1"
+
+ __pattern__ = r'http://(?:www\.)?unibytes\.com/[a-zA-Z0-9-._ ]{11}B'
+
__description__ = """UniBytes.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_INFO_PATTERN = r'<span[^>]*?id="fileName"[^>]*>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)'
- DOMAIN = 'http://www.unibytes.com'
+ HOSTER_NAME = "unibytes.com"
WAIT_PATTERN = r'Wait for <span id="slowRest">(\d+)</span> sec'
- DOWNLOAD_LINK_PATTERN = r'<a href="([^"]+)">Download</a>'
+ LINK_PATTERN = r'<a href="([^"]+)">Download</a>'
+
def handleFree(self):
+ domain = "http://www." + self.HOSTER_NAME
action, post_data = self.parseHtmlForm('id="startForm"')
self.req.http.c.setopt(FOLLOWLOCATION, 0)
for _ in xrange(8):
self.logDebug(action, post_data)
- self.html = self.load(self.DOMAIN + action, post=post_data)
+ self.html = self.load(domain + action, post=post_data)
- found = re.search(r'location:\s*(\S+)', self.req.http.header, re.I)
- if found:
- url = found.group(1)
+ m = re.search(r'location:\s*(\S+)', self.req.http.header, re.I)
+ if m:
+ url = m.group(1)
break
if '>Somebody else is already downloading using your IP-address<' in self.html:
@@ -55,9 +44,9 @@ class UnibytesCom(SimpleHoster):
self.retry()
if post_data['step'] == 'last':
- found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html)
- if found:
- url = found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m:
+ url = m.group(1)
self.correctCaptcha()
break
else:
@@ -67,10 +56,10 @@ class UnibytesCom(SimpleHoster):
action, post_data = self.parseHtmlForm('id="stepForm"')
if last_step == 'timer':
- found = re.search(self.WAIT_PATTERN, self.html)
- self.wait(int(found.group(1)) if found else 60, False)
- elif last_step in ('captcha', 'last'):
- post_data['captcha'] = self.decryptCaptcha(self.DOMAIN + '/captcha.jpg')
+ m = re.search(self.WAIT_PATTERN, self.html)
+ self.wait(int(m.group(1)) if m else 60, False)
+ elif last_step in ("captcha", "last"):
+ post_data['captcha'] = self.decryptCaptcha(domain + '/captcha.jpg')
else:
self.fail("No valid captcha code entered")
diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py
index a0447d873..ed70e023d 100644
--- a/module/plugins/hoster/UnrestrictLi.py
+++ b/module/plugins/hoster/UnrestrictLi.py
@@ -1,29 +1,15 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
+
from datetime import datetime, timedelta
-from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
-def secondsToMidnight():
- # Seconds until 00:10 GMT+2
- now = datetime.utcnow() + timedelta(hours=2)
+def secondsToMidnight(gmt=0):
+ now = datetime.utcnow() + timedelta(hours=gmt)
if now.hour is 0 and now.minute < 10:
midnight = now
else:
@@ -34,13 +20,16 @@ def secondsToMidnight():
class UnrestrictLi(Hoster):
__name__ = "UnrestrictLi"
- __version__ = "0.11"
__type__ = "hoster"
+ __version__ = "0.12"
+
__pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li'
+
__description__ = """Unrestrict.li hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def setup(self):
self.chunkLimit = 16
self.resumeDownload = True
@@ -72,8 +61,8 @@ class UnrestrictLi(Hoster):
elif "You are not allowed to download from this host" in page:
self.fail("You are not allowed to download from this host")
elif "You have reached your daily limit for this host" in page:
- self.logInfo("Reached daily limit for this host. Waiting until 00:10 GMT+2")
- self.retry(5, secondsToMidnight(), "Daily limit for this host reached")
+ self.logWarning("Reached daily limit for this host")
+ self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached")
elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in page:
self.logInfo("Hoster temporarily unavailable, waiting 1 minute and retry")
self.retry(5, 60, "Hoster is temporarily unavailable")
diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py
index b0229aba4..ac5a47f3f 100644
--- a/module/plugins/hoster/UploadStationCom.py
+++ b/module/plugins/hoster/UploadStationCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class UploadStationCom(DeadHoster):
__name__ = "UploadStationCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?uploadstation\.com/file/(?P<id>[A-Za-z0-9]+)'
__version__ = "0.52"
+
+ __pattern__ = r'http://(?:www\.)?uploadstation\.com/file/(?P<id>[A-Za-z0-9]+)'
+
__description__ = """UploadStation.com hoster plugin"""
__author_name__ = ("fragonib", "zoidberg")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es", "zoidberg@mujmail.cz")
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 6d17bcbd9..286f1caf0 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-
-
-# Test links (random.bin):
+#
+# Test links:
# http://ul.to/044yug9o
# http://ul.to/gzfhd0xs
import re
-from time import sleep
-from module.utils import html_unescape, parseFileSize
+from time import sleep
-from module.plugins.Hoster import Hoster
from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
from module.plugins.Plugin import chunks
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.utils import html_unescape, parseFileSize
+
key = "bGhGMkllZXByd2VEZnU5Y2NXbHhYVlZ5cEE1bkEzRUw=".decode('base64')
@@ -30,7 +31,7 @@ def getAPIData(urls):
for i, url in enumerate(urls):
id = getID(url)
- post["id_%s" % i] = id
+ post['id_%s' % i] = id
idMap[id] = url
for _ in xrange(5):
@@ -54,17 +55,22 @@ def getAPIData(urls):
def parseFileInfo(self, url='', html=''):
if not html and hasattr(self, "html"):
html = self.html
- name, size, status, found, fileid = url, 0, 3, None, None
- if re.search(self.FILE_OFFLINE_PATTERN, html):
+ name = url
+ size = 0
+ fileid = None
+
+ if re.search(self.OFFLINE_PATTERN, html):
# File offline
status = 1
else:
- found = re.search(self.FILE_INFO_PATTERN, html)
- if found:
- name, fileid = html_unescape(found.group('N')), found.group('ID')
- size = parseFileSize(found.group('S'))
+ m = re.search(self.FILE_INFO_PATTERN, html)
+ if m:
+ name, fileid = html_unescape(m.group('N')), m.group('ID')
+ size = parseFileSize(m.group('S'))
status = 2
+ else:
+ status = 3
return name, size, status, fileid
@@ -88,16 +94,19 @@ def getInfo(urls):
class UploadedTo(Hoster):
__name__ = "UploadedTo"
__type__ = "hoster"
+ __version__ = "0.73"
+
__pattern__ = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P<ID>\w+)'
- __version__ = "0.72"
+
__description__ = """Uploaded.net hoster plugin"""
__author_name__ = ("spoob", "mkaay", "zoidberg", "netpok", "stickell")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz",
"netpok@gmail.com", "l.stickell@yahoo.it")
FILE_INFO_PATTERN = r'<a href="file/(?P<ID>\w+)" id="filename">(?P<N>[^<]+)</a> &nbsp;\s*<small[^>]*>(?P<S>[^<]+)</small>'
- FILE_OFFLINE_PATTERN = r'<small class="cL">Error: 404</small>'
- DL_LIMIT_PATTERN = "You have reached the max. number of possible free downloads for this hour"
+ OFFLINE_PATTERN = r'<small class="cL">Error: 404</small>'
+ DL_LIMIT_PATTERN = r'You have reached the max. number of possible free downloads for this hour'
+
def setup(self):
self.multiDL = self.resumeDownload = self.premium
@@ -148,8 +157,8 @@ class UploadedTo(Hoster):
def handlePremium(self):
info = self.account.getAccountInfo(self.user, True)
self.logDebug("%(name)s: Use Premium Account (%(left)sGB left)" % {"name": self.__name__,
- "left": info["trafficleft"] / 1024 / 1024})
- if int(self.data[1]) / 1024 > info["trafficleft"]:
+ "left": info['trafficleft'] / 1024 / 1024})
+ if int(self.data[1]) / 1024 > info['trafficleft']:
self.logInfo(_("%s: Not enough traffic left" % self.__name__))
self.account.empty(self.user)
self.resetAccount()
@@ -163,10 +172,10 @@ class UploadedTo(Hoster):
else:
#Indirect download
self.html = self.load("http://uploaded.net/file/%s" % self.fileID)
- found = re.search(r'<div class="tfree".*\s*<form method="post" action="(.*?)"', self.html)
- if not found:
- self.fail("Download URL not found. Try to enable direct downloads.")
- url = found.group(1)
+ m = re.search(r'<div class="tfree".*\s*<form method="post" action="(.*?)"', self.html)
+ if m is None:
+ self.fail("Download URL not m. Try to enable direct downloads.")
+ url = m.group(1)
print "Premium URL: " + url
self.download(url, post={})
@@ -177,10 +186,10 @@ class UploadedTo(Hoster):
self.logError("Free-download capacities exhausted.")
self.retry(max_tries=24, wait_time=5 * 60)
- found = re.search(r"Current waiting period: <span>(\d+)</span> seconds", self.html)
- if not found:
+ m = re.search(r"Current waiting period: <span>(\d+)</span> seconds", self.html)
+ if m is None:
self.fail("File not downloadable for free users")
- self.setWait(int(found.group(1)))
+ self.setWait(int(m.group(1)))
js = self.load("http://uploaded.net/js/download.js", decode=True)
@@ -210,7 +219,7 @@ class UploadedTo(Hoster):
self.setWait(3 * 60 * 60, True)
self.wait()
self.retry()
- elif 'err:"captcha"' in result:
+ elif '"err":"captcha"' in result:
self.logError("ul.net captcha is disabled")
self.invalidCaptcha()
elif "type:'download'" in result:
@@ -218,7 +227,7 @@ class UploadedTo(Hoster):
downloadURL = re.search("url:'([^']+)", result).group(1)
break
else:
- self.fail("Unknown error '%s'")
+ self.fail("Unknown error '%s'" % result)
if not downloadURL:
self.fail("No Download url retrieved/all captcha attempts failed")
diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py
index 6ee3dbeba..e34701ed7 100644
--- a/module/plugins/hoster/UploadheroCom.py
+++ b/module/plugins/hoster/UploadheroCom.py
@@ -1,66 +1,53 @@
# -*- coding: utf-8 -*-
-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
-# Test link (random.bin):
+#
+# Test links:
# http://uploadhero.co/dl/wQBRAVSM
import re
+
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UploadheroCom(SimpleHoster):
__name__ = "UploadheroCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?uploadhero\.com?/dl/\w+'
__version__ = "0.15"
+
+ __pattern__ = r'http://(?:www\.)?uploadhero\.com?/dl/\w+'
+
__description__ = """UploadHero.co plugin"""
__author_name__ = ("mcmyst", "zoidberg")
__author_mail__ = ("mcmyst@hotmail.fr", "zoidberg@mujmail.cz")
- SH_COOKIES = [("http://uploadhero.co", "lang", "en")]
FILE_NAME_PATTERN = r'<div class="nom_de_fichier">(?P<N>.*?)</div>'
FILE_SIZE_PATTERN = r'Taille du fichier : </span><strong>(?P<S>.*?)</strong>'
- FILE_OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.'
+ OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.'
- DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"'
+ SH_COOKIES = [(".uploadhero.co", "lang", "en")]
IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"'
IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>'
CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"'
FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.co/\?d=[A-Za-z0-9]+/[^<>"/]+)"'
+ PREMIUM_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"'
+
def handleFree(self):
self.checkErrors()
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if not found:
+ m = re.search(self.CAPTCHA_PATTERN, self.html)
+ if m is None:
self.parseError("Captcha URL")
- captcha_url = "http://uploadhero.co" + found.group(1)
+ captcha_url = "http://uploadhero.co" + m.group(1)
for _ in xrange(5):
captcha = self.decryptCaptcha(captcha_url)
self.html = self.load(self.pyfile.url, get={"code": captcha})
- found = re.search(self.FREE_URL_PATTERN, self.html)
- if found:
+ m = re.search(self.FREE_URL_PATTERN, self.html)
+ if m:
self.correctCaptcha()
- download_url = found.group(1) or found.group(2)
+ download_url = m.group(1) or m.group(2)
break
else:
self.invalidCaptcha()
@@ -72,17 +59,17 @@ class UploadheroCom(SimpleHoster):
def handlePremium(self):
self.logDebug("%s: Use Premium Account" % self.__name__)
self.html = self.load(self.pyfile.url)
- link = re.search(self.DOWNLOAD_URL_PATTERN, self.html).group(1)
+ link = re.search(self.PREMIUM_URL_PATTERN, self.html).group(1)
self.logDebug("Downloading link : '%s'" % link)
self.download(link)
def checkErrors(self):
- found = re.search(self.IP_BLOCKED_PATTERN, self.html)
- if found:
- self.html = self.load("http://uploadhero.co%s" % found.group(1))
+ m = re.search(self.IP_BLOCKED_PATTERN, self.html)
+ if m:
+ self.html = self.load("http://uploadhero.co%s" % m.group(1))
- found = re.search(self.IP_WAIT_PATTERN, self.html)
- wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 5 * 60
+ m = re.search(self.IP_WAIT_PATTERN, self.html)
+ wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 5 * 60
self.wait(wait_time, True)
self.retry()
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py
index f3cc7a1c6..45ab1d4cd 100644
--- a/module/plugins/hoster/UploadingCom.py
+++ b/module/plugins/hoster/UploadingCom.py
@@ -1,48 +1,35 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: jeix
-"""
-
import re
+
from pycurl import HTTPHEADER
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
from module.common.json_layer import json_loads
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
class UploadingCom(SimpleHoster):
__name__ = "UploadingCom"
__type__ = "hoster"
+ __version__ = "0.36"
+
__pattern__ = r'http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>[\w\d]+)'
- __version__ = "0.34"
+
__description__ = """Uploading.com hoster plugin"""
__author_name__ = ("jeix", "mkaay", "zoidberg")
__author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
FILE_NAME_PATTERN = r'id="file_title">(?P<N>.+)</'
FILE_SIZE_PATTERN = r'size tip_container">(?P<S>[\d.]+) (?P<U>\w+)<'
- FILE_OFFLINE_PATTERN = r'Page not found!'
+ OFFLINE_PATTERN = r'(Page|file) not found'
+
def process(self, pyfile):
# set lang to english
- self.req.cj.setCookie("uploading.com", "lang", "1")
- self.req.cj.setCookie("uploading.com", "language", "1")
- self.req.cj.setCookie("uploading.com", "setlang", "en")
- self.req.cj.setCookie("uploading.com", "_lang", "en")
+ self.req.cj.setCookie(".uploading.com", "lang", "1")
+ self.req.cj.setCookie(".uploading.com", "language", "1")
+ self.req.cj.setCookie(".uploading.com", "setlang", "en")
+ self.req.cj.setCookie(".uploading.com", "_lang", "en")
if not "/get/" in pyfile.url:
pyfile.url = pyfile.url.replace("/files", "/files/get")
@@ -69,11 +56,11 @@ class UploadingCom(SimpleHoster):
raise Exception("Plugin defect.")
def handleFree(self):
- found = re.search('<h2>((Daily )?Download Limit)</h2>', self.html)
- if found:
- self.pyfile.error = found.group(1)
+ m = re.search('<h2>((Daily )?Download Limit)</h2>', self.html)
+ if m:
+ self.pyfile.error = m.group(1)
self.logWarning(self.pyfile.error)
- self.retry(max_tries=6, wait_time=6 * 60 * 60 if found.group(2) else 15 * 60, reason=self.pyfile.error)
+ self.retry(max_tries=6, wait_time=6 * 60 * 60 if m.group(2) else 15 * 60, reason=self.pyfile.error)
ajax_url = "http://uploading.com/files/get/?ajax"
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
@@ -85,21 +72,21 @@ class UploadingCom(SimpleHoster):
self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time))
self.wait(wait_time)
else:
- self.pluginParseError("AJAX/WAIT")
+ self.parseError("AJAX/WAIT")
response = json_loads(
self.load(ajax_url, post={'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'}))
if 'answer' in response and 'link' in response['answer']:
url = response['answer']['link']
else:
- self.pluginParseError("AJAX/URL")
+ self.parseError("AJAX/URL")
self.html = self.load(url)
- found = re.search(r'<form id="file_form" action="(.*?)"', self.html)
- if found:
- url = found.group(1)
+ m = re.search(r'<form id="file_form" action="(.*?)"', self.html)
+ if m:
+ url = m.group(1)
else:
- self.pluginParseError("URL")
+ self.parseError("URL")
self.download(url)
diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py
index 9d1c4b3dd..140024731 100644
--- a/module/plugins/hoster/UpstoreNet.py
+++ b/module/plugins/hoster/UpstoreNet.py
@@ -1,29 +1,34 @@
# -*- coding: utf-8 -*-
+
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UpstoreNet(SimpleHoster):
__name__ = "UpstoreNet"
__type__ = "hoster"
- __pattern__ = r"https?://(?:www\.)?upstore\.net/"
__version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?upstore\.net/'
+
__description__ = """Upstore.Net File Download Hoster"""
- __author_name__ = ("igel")
+ __author_name__ = "igel"
+ __author_mail__ = "igelkun@myopera.com"
FILE_INFO_PATTERN = r'<div class="comment">.*?</div>\s*\n<h2 style="margin:0">(?P<N>.*?)</h2>\s*\n<div class="comment">\s*\n\s*(?P<S>[\d.]+) (?P<U>\w+)'
- FILE_OFFLINE_PATTERN = r'<span class="error">File not found</span>'
+ OFFLINE_PATTERN = r'<span class="error">File not found</span>'
- WAIT_PATTERN = r"var sec = (\d+)"
+ WAIT_PATTERN = r'var sec = (\d+)'
CHASH_PATTERN = r'<input type="hidden" name="hash" value="([^"]*)">'
- DIRECT_LINK_PATTERN = r'<a href="(https?://.*?)" target="_blank"><b>'
+ LINK_PATTERN = r'<a href="(https?://.*?)" target="_blank"><b>'
+
def handleFree(self):
# STAGE 1: get link to continue
m = re.search(self.CHASH_PATTERN, self.html)
- if not m:
+ if m is None:
self.parseError("could not detect hash")
chash = m.group(1)
self.logDebug("read hash " + chash)
@@ -40,7 +45,7 @@ class UpstoreNet(SimpleHoster):
# try the captcha 5 times
for i in xrange(5):
m = re.search(self.WAIT_PATTERN, self.html)
- if not m:
+ if m is None:
self.parseError("could not find wait pattern")
wait_time = m.group(1)
@@ -55,11 +60,11 @@ class UpstoreNet(SimpleHoster):
self.html = self.load(self.pyfile.url, post=post_data, decode=True)
# STAGE 3: get direct link
- m = re.search(self.DIRECT_LINK_PATTERN, self.html, re.DOTALL)
+ m = re.search(self.LINK_PATTERN, self.html, re.DOTALL)
if m:
break
- if not m:
+ if m is None:
self.parseError("could not detect direct link")
direct = m.group(1)
diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py
index e403425c1..6d86c5559 100644
--- a/module/plugins/hoster/UptoboxCom.py
+++ b/module/plugins/hoster/UptoboxCom.py
@@ -1,22 +1,7 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# @author: Walter Purcaro
-###############################################################################
import re
+
from urllib import unquote
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
@@ -27,8 +12,10 @@ from module.utils import html_unescape
class UptoboxCom(XFileSharingPro):
__name__ = "UptoboxCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w+'
__version__ = "0.09"
+
+ __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w+'
+
__description__ = """Uptobox.com hoster plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
@@ -36,30 +23,31 @@ class UptoboxCom(XFileSharingPro):
HOSTER_NAME = "uptobox.com"
FILE_INFO_PATTERN = r'"para_title">(?P<N>.+) \((?P<S>[\d\.]+) (?P<U>\w+)\)'
- FILE_OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)'
+ OFFLINE_PATTERN = r'>(File not found|Access Denied|404 Not Found)'
TEMP_OFFLINE_PATTERN = r'>This server is in maintenance mode'
WAIT_PATTERN = r'>(\d+)</span> seconds<'
- DIRECT_LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"'
+ LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"'
+
def handleCaptcha(self, inputs):
- found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
captcha = SolveMedia(self)
inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key)
return 4
else:
- found = re.search(self.CAPTCHA_URL_PATTERN, self.html)
- if found:
- captcha_url = found.group(1)
+ m = re.search(self.CAPTCHA_URL_PATTERN, self.html)
+ if m:
+ captcha_url = m.group(1)
inputs['code'] = self.decryptCaptcha(captcha_url)
return 2
else:
- found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL)
- if found:
- captcha_div = found.group(1)
+ m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL)
+ if m:
+ captcha_div = m.group(1)
self.logDebug(captcha_div)
numerals = re.findall(r'<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>',
html_unescape(captcha_div))
@@ -67,9 +55,9 @@ class UptoboxCom(XFileSharingPro):
self.logDebug("CAPTCHA", inputs['code'], numerals)
return 3
else:
- found = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
- if found:
- recaptcha_key = unquote(found.group(1))
+ m = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
+ if m:
+ recaptcha_key = unquote(m.group(1))
self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key)
recaptcha = ReCaptcha(self)
inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(
diff --git a/module/plugins/hoster/VeehdCom.py b/module/plugins/hoster/VeehdCom.py
index 22fc4b207..66c258439 100644
--- a/module/plugins/hoster/VeehdCom.py
+++ b/module/plugins/hoster/VeehdCom.py
@@ -1,20 +1,24 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
class VeehdCom(Hoster):
- __name__ = 'VeehdCom'
- __type__ = 'hoster'
+ __name__ = "VeehdCom"
+ __type__ = "hoster"
+ __version__ = "0.23"
+
__pattern__ = r'http://veehd\.com/video/\d+_\S+'
__config__ = [("filename_spaces", "bool", "Allow spaces in filename", False),
("replacement_char", "str", "Filename replacement character", "_")]
- __version__ = '0.23'
+
__description__ = """Veehd.com hoster plugin"""
__author_name__ = "cat"
__author_mail__ = "cat@pyload"
+
def _debug(self, msg):
self.logDebug('[%s] %s' % (self.__name__, msg))
@@ -36,7 +40,7 @@ class VeehdCom(Hoster):
self.html = self.load(url)
def file_exists(self):
- if self.html is None:
+ if not self.html:
self.download_html()
if '<title>Veehd</title>' in self.html:
@@ -44,13 +48,14 @@ class VeehdCom(Hoster):
return True
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
- match = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
- if not match:
+ m = re.search(r'<title[^>]*>([^<]+) on Veehd</title>', self.html)
+ if m is None:
self.fail("video title not found")
- name = match.group(1)
+
+ name = m.group(1)
# replace unwanted characters in filename
if self.getConfig('filename_spaces'):
@@ -58,20 +63,17 @@ class VeehdCom(Hoster):
else:
pattern = '[^0-9A-Za-z\.]+'
- name = re.sub(pattern, self.getConfig('replacement_char'),
- name)
- return name + '.avi'
+ return re.sub(pattern, self.getConfig('replacement_char'), name) + '.avi'
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
- match = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
+ m = re.search(r'<embed type="video/divx" src="(http://([^/]*\.)?veehd\.com/dl/[^"]+)"',
self.html)
- if not match:
+ if m is None:
self.fail("embedded video url not found")
- file_url = match.group(1)
- return file_url
+ return m.group(1)
diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py
index c1ebffb81..fcd5e90a4 100644
--- a/module/plugins/hoster/VeohCom.py
+++ b/module/plugins/hoster/VeohCom.py
@@ -1,18 +1,4 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero 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 Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-############################################################################
import re
@@ -22,35 +8,44 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class VeohCom(SimpleHoster):
__name__ = "VeohCom"
__type__ = "hoster"
+ __version__ = "0.2"
+
__pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?P<ID>v\w+)'
- __version__ = "0.1"
- __config__ = [("quality", "Low;High", "Quality", "High")]
+ __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")]
+
__description__ = """Veoh.com hoster plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
FILE_NAME_PATTERN = r'<meta name="title" content="(?P<N>.*?)"'
- FILE_OFFLINE_PATTERN = r'>Sorry, we couldn\'t find the video you were looking for'
+ OFFLINE_PATTERN = r'>Sorry, we couldn\'t find the video you were looking for'
FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g<ID>')]
SH_COOKIES = [(".veoh.com", "lassieLocale", "en")]
+
def setup(self):
self.resumeDownload = self.multiDL = True
self.chunkLimit = -1
def handleFree(self):
- q = self.getConfig("quality")
- pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q
- found = re.search(pattern, self.html)
- if found:
- self.pyfile.name += ".mp4"
- link = found.group(1).replace("\\", "")
- self.logDebug("Download link: " + link)
- self.download(link)
+ quality = self.getConfig("quality")
+ if quality == "Auto":
+ quality = ("High", "Low")
+ for q in quality:
+ pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q
+ m = re.search(pattern, self.html)
+ if m:
+ self.pyfile.name += ".mp4"
+ link = m.group(1).replace("\\", "")
+ self.logDebug("Download link: " + link)
+ self.download(link)
+ return
+ else:
+ self.logInfo("No %s quality video found" % q.upper())
else:
- self.fail("No %s quality video found" % q.lower())
+ self.fail("No video found!")
getInfo = create_getInfo(VeohCom)
diff --git a/module/plugins/hoster/VidPlayNet.py b/module/plugins/hoster/VidPlayNet.py
index ade416750..eb7a13e4c 100644
--- a/module/plugins/hoster/VidPlayNet.py
+++ b/module/plugins/hoster/VidPlayNet.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-
+#
# Test links:
# BigBuckBunny_320x180.mp4 - 61.7 Mb - http://vidplay.net/38lkev0h3jv0
@@ -9,17 +9,19 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf
class VidPlayNet(XFileSharingPro):
__name__ = "VidPlayNet"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?vidplay\.net/\w{12}'
__version__ = "0.01"
+
+ __pattern__ = r'https?://(?:www\.)?vidplay\.net/\w{12}'
+
__description__ = """VidPlay.net hoster plugin"""
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
HOSTER_NAME = "vidplay.net"
- FILE_OFFLINE_PATTERN = r'<b>File Not Found</b><br>\s*<br>'
+ OFFLINE_PATTERN = r'<b>File Not Found</b><br>\s*<br>'
FILE_NAME_PATTERN = r'<b>Password:</b></div>\s*<h[1-6]>(?P<N>[^<]+)</h[1-6]>'
- DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<&]+)' % HOSTER_NAME
+ LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<&]+)' % HOSTER_NAME
getInfo = create_getInfo(VidPlayNet)
diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py
new file mode 100644
index 000000000..145d9053f
--- /dev/null
+++ b/module/plugins/hoster/VimeoCom.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class VimeoCom(SimpleHoster):
+ __name__ = "VimeoCom"
+ __type__ = "hoster"
+ __version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P<ID>\d+)'
+ __config__ = [("quality", "Lowest;Mobile;SD;HD;Highest", "Quality", "Highest"),
+ ("original", "bool", "Try to download the original file first", True)]
+
+ __description__ = """Vimeo.com hoster plugin"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
+
+ FILE_NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<'
+ OFFLINE_PATTERN = r'class="exception_header"'
+ TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<'
+
+ FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')]
+
+ SH_COOKIES = [(".vimeo.com", "language", "en")]
+
+
+ def setup(self):
+ self.resumeDownload = self.multiDL = True
+ self.chunkLimit = -1
+
+ def handleFree(self):
+ password = self.getPassword()
+
+ if self.js and 'class="btn iconify_down_b"' in self.html:
+ html = self.js.eval(self.load(self.pyfile.url, get={'action': "download", 'password': password}, decode=True))
+ pattern = r'href="(?P<URL>http://vimeo\.com.+?)".*?\>(?P<QL>.+?) '
+ else:
+ id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ html = self.load("https://player.vimeo.com/video/" + id, get={'password': password})
+ pattern = r'"(?P<QL>\w+)":{"profile".*?"(?P<URL>http://pdl\.vimeocdn\.com.+?)"'
+
+ link = dict([(l.group('QL').lower(), l.group('URL')) for l in re.finditer(pattern, html)])
+
+ if self.getConfig("original"):
+ if "original" in link:
+ self.download(link[q])
+ return
+ else:
+ self.logInfo("Original file not downloadable")
+
+ quality = self.getConfig("quality")
+ if quality == "Highest":
+ qlevel = ("hd", "sd", "mobile")
+ elif quality == "Lowest":
+ qlevel = ("mobile", "sd", "hd")
+ else:
+ qlevel = quality.lower()
+
+ for q in qlevel:
+ if q in link:
+ self.download(link[q])
+ return
+ else:
+ self.logInfo("No %s quality video found" % q.upper())
+ else:
+ self.fail("No video found!")
+
+
+getInfo = create_getInfo(VimeoCom)
diff --git a/module/plugins/hoster/Vipleech4uCom.py b/module/plugins/hoster/Vipleech4uCom.py
index 53768a430..da7131d39 100644
--- a/module/plugins/hoster/Vipleech4uCom.py
+++ b/module/plugins/hoster/Vipleech4uCom.py
@@ -1,84 +1,18 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
-from module.plugins.Hoster import Hoster
-
-class Vipleech4uCom(Hoster):
+class Vipleech4uCom(DeadHoster):
__name__ = "Vipleech4uCom"
- __version__ = "0.1"
__type__ = "hoster"
- __pattern__ = r"http://vipleech4u.com/manager.php"
- __description__ = """Vipleech4u.com hoster plugin"""
- __author_name__ = ("Kagenoshin")
- __author_mail__ = ("kagenoshin@gmx.ch")
-
- FILENAME_PATTERN = re.compile(r'name\s*?=\s*?["\']filename["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- HOST_PATTERN = re.compile(r'name\s*?=\s*?["\']host["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- PATH_PATTERN = re.compile(r'name\s*?=\s*?["\']path["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- REFERER_PATTERN = re.compile(r'name\s*?=\s*?["\']referer["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- LINK_PATTERN = re.compile(r'name\s*?=\s*?["\']link["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
- COOKIE_PATTERN = re.compile(r'name\s*?=\s*?["\']cookie["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I)
-
- def setup(self):
- self.resumeDownload = self.multiDL = True
- self.chunkLimit = 1
-
- def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "vipleech4u.com")
- self.fail("No vipleech4u.com account provided")
-
- self.logDebug("Old URL: %s" % pyfile.url)
-
- new_url = pyfile.url
-
- if re.match(self.__pattern__, new_url):
- self.fail("Can't handle vipleech4u links.")
+ __version__ = "0.2"
- #upload the link which has to be loaded
- page = self.load('http://vipleech4u.com/generator.php', post={'links': new_url, 'ddl': 'no'})
+ __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php'
- #switch to the manager and see what's happening
- page = self.load('http://vipleech4u.com/unrestrict.php', get={'link': new_url, 'premium_acc': 'on'})
-
- if re.search(r'You have generated maximum links available to you today', page, re.I):
- self.fail('Daily limit reached.')
-
- filename = self.FILENAME_PATTERN.search(page)
- host = self.HOST_PATTERN.search(page)
- path = self.PATH_PATTERN.search(page)
- referer = self.REFERER_PATTERN.search(page)
- link = self.LINK_PATTERN.search(page)
- cookie = self.COOKIE_PATTERN.search(page)
-
- #build the post-dictionary
- post_dict = {}
-
- if filename:
- post_dict.update({'filename': filename.group(1)})
- if host:
- post_dict.update({'host': host.group(1)})
- if path:
- post_dict.update({'path': path.group(1)})
- if referer:
- post_dict.update({'referer': referer.group(1)})
- if link:
- post_dict.update({'link': link.group(1)})
- if cookie:
- post_dict.update({'cookie': cookie.group(1)})
-
- if not post_dict:
- self.logDebug('Get an empty post_dict. Strange.')
-
- self.setWait(5)
- self.wait()
- self.logDebug("Unrestricted URL: " + str(post_dict))
-
- self.download('http://vipleech4u.com/unrestrict.php', post=post_dict, disposition=True)
+ __description__ = """Vipleech4u.com hoster plugin"""
+ __author_name__ = "Kagenoshin"
+ __author_mail__ = "kagenoshin@gmx.ch"
- check = self.checkDownload({"bad": "<html"})
- if check == "bad":
- self.retry(24, 150, 'Bad file downloaded')
+getInfo = create_getInfo(Vipleech4uCom)
diff --git a/module/plugins/hoster/WarserverCz.py b/module/plugins/hoster/WarserverCz.py
index a80349b45..8a565d777 100644
--- a/module/plugins/hoster/WarserverCz.py
+++ b/module/plugins/hoster/WarserverCz.py
@@ -1,77 +1,18 @@
# -*- coding: utf-8 -*-
-"""
- 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.
+from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
- 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/>.
-
- @author: zoidberg
-"""
-
-#similar to coolshare.cz (down)
-
-import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.HTTPRequest import BadHeader
-from module.utils import html_unescape
-
-
-class WarserverCz(SimpleHoster):
+class WarserverCz(DeadHoster):
__name__ = "WarserverCz"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?warserver.cz/stahnout/(?P<ID>\d+)/.+'
- __version__ = "0.12"
- __description__ = """Warserver.cz hoster plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
+ __version__ = "0.13"
- FILE_NAME_PATTERN = r'<h1.*?>(?P<N>[^<]+)</h1>'
- FILE_SIZE_PATTERN = r'<li>Velikost: <strong>(?P<S>[^<]+)</strong>'
- FILE_OFFLINE_PATTERN = r'<h1>Soubor nenalezen</h1>'
+ __pattern__ = r'http://(?:www\.)?warserver\.cz/stahnout/\d+'
- PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"'
- DOMAIN = "http://csd01.coolshare.cz"
-
- DOMAIN = "http://s01.warserver.cz"
-
- def handleFree(self):
- try:
- self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID']))
- except BadHeader, e:
- self.logError(e)
- if e.code == 403:
- self.longWait(60, 60)
- else:
- raise
- self.checkDownloadedFile()
-
- def handlePremium(self):
- found = re.search(self.PREMIUM_URL_PATTERN, self.html)
- if not found:
- self.parseError("Premium URL")
- url = html_unescape(found.group(1))
- self.logDebug("Premium URL: " + url)
- if not url.startswith("http://"):
- self.resetAccount()
- self.download(url)
- self.checkDownloadedFile()
-
- def checkDownloadedFile(self):
- check = self.checkDownload({
- "offline": ">404 Not Found<"
- })
-
- if check == "offline":
- self.offline()
+ __description__ = """Warserver.cz hoster plugin"""
+ __author_name__ = "Walter Purcaro"
+ __author_mail__ = "vuolter@gmail.com"
getInfo = create_getInfo(WarserverCz)
diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py
index 53dc3b95c..a3918d5c4 100644
--- a/module/plugins/hoster/WebshareCz.py
+++ b/module/plugins/hoster/WebshareCz.py
@@ -1,23 +1,9 @@
# -*- coding: utf-8 -*-
-############################################################################
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
-# #
-# You should have received a copy of the GNU Affero General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-############################################################################
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster
from module.network.RequestFactory import getRequest
+from module.plugins.internal.SimpleHoster import SimpleHoster
def getInfo(urls):
@@ -38,17 +24,20 @@ def getInfo(urls):
class WebshareCz(SimpleHoster):
__name__ = "WebshareCz"
__type__ = "hoster"
- __pattern__ = r'https?://(?:www\.)?webshare.cz/(?:#/)?file/(?P<ID>\w+)'
__version__ = "0.13"
+
+ __pattern__ = r'https?://(?:www\.)?webshare.cz/(?:#/)?file/(?P<ID>\w+)'
+
__description__ = """WebShare.cz hoster plugin"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def handleFree(self):
api_data = self.load('https://webshare.cz/api/file_link/', post={'ident': self.fid})
self.logDebug("API data: " + api_data)
m = re.search('<link>(.+)</link>', api_data)
- if not m:
+ if m is None:
self.parseError('Unable to detect direct link')
direct = m.group(1)
self.logDebug("Direct link: " + direct)
diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py
index 7966b980a..3b26b1a02 100644
--- a/module/plugins/hoster/WrzucTo.py
+++ b/module/plugins/hoster/WrzucTo.py
@@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from pycurl import HTTPHEADER
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -26,15 +10,19 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class WrzucTo(SimpleHoster):
__name__ = "WrzucTo"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?wrzuc\.to/([a-zA-Z0-9]+(\.wt|\.html)|(\w+/?linki/[a-zA-Z0-9]+))'
__version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?wrzuc\.to/([a-zA-Z0-9]+(\.wt|\.html)|(\w+/?linki/[a-zA-Z0-9]+))'
+
__description__ = """Wrzuc.to hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- SH_COOKIES = [("http://www.wrzuc.to", "language", "en")]
- FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>'
FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>'
+ FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>'
+
+ SH_COOKIES = [(".wrzuc.to", "language", "en")]
+
def setup(self):
self.multiDL = True
diff --git a/module/plugins/hoster/WuploadCom.py b/module/plugins/hoster/WuploadCom.py
index a0228081c..b06318d42 100644
--- a/module/plugins/hoster/WuploadCom.py
+++ b/module/plugins/hoster/WuploadCom.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class WuploadCom(DeadHoster):
__name__ = "WuploadCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?'
__version__ = "0.23"
+
+ __pattern__ = r'http://(?:www\.)?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?'
+
__description__ = """Wupload.com hoster plugin"""
__author_name__ = ("jeix", "Paul King")
__author_mail__ = ("jeix@hasnomail.de", "")
diff --git a/module/plugins/hoster/X7To.py b/module/plugins/hoster/X7To.py
index 810ede911..cbd4b8b8e 100644
--- a/module/plugins/hoster/X7To.py
+++ b/module/plugins/hoster/X7To.py
@@ -6,8 +6,10 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class X7To(DeadHoster):
__name__ = "X7To"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?x7.to/'
__version__ = "0.41"
+
+ __pattern__ = r'http://(?:www\.)?x7.to/'
+
__description__ = """X7.to hoster plugin"""
__author_name__ = "ernieb"
__author_mail__ = "ernieb"
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index f69283c47..25492fb49 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -1,31 +1,16 @@
# -*- coding: utf-8 -*-
-###############################################################################
-# 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/>.
-#
-# @author: zoidberg
-###############################################################################
-
import re
+
+from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
from random import random
from urllib import unquote
from urlparse import urlparse
-from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError, replace_patterns
+
+from module.network.RequestFactory import getURL
from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError, replace_patterns
from module.utils import html_unescape
-from module.network.RequestFactory import getURL
class XFileSharingPro(SimpleHoster):
@@ -36,27 +21,31 @@ class XFileSharingPro(SimpleHoster):
"""
__name__ = "XFileSharingPro"
__type__ = "hoster"
+ __version__ = "0.32"
+
__pattern__ = r'^unmatchable$'
- __version__ = "0.31"
+
__description__ = """XFileSharingPro base hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+ FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>'
FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"'
FILE_SIZE_PATTERN = r'You have requested .*\((?P<S>[\d\.\,]+) ?(?P<U>\w+)?\)</font>'
- FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>'
- FILE_OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)'
+ OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)'
WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>'
- #LONG_WAIT_PATTERN = r'(?P<H>\d+(?=\s*hour))?.*?(?P<M>\d+(?=\s*minute))?.*?(?P<S>\d+(?=\s*second))?'
- OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
- OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)'
+
+ OVR_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
+
CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)'
RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"'
CAPTCHA_DIV_PATTERN = r'>Enter code.*?<div.*?>(.*?)</div>'
SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"'
+
ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)</'
+
def setup(self):
if self.__name__ == "XFileSharingPro":
self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
@@ -103,8 +92,8 @@ class XFileSharingPro(SimpleHoster):
""" Initialize important variables """
if not hasattr(self, "HOSTER_NAME"):
self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1)
- if not hasattr(self, "DIRECT_LINK_PATTERN"):
- self.DIRECT_LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
+ if not hasattr(self, "LINK_PATTERN"):
+ self.LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME
self.captcha = self.errmsg = None
self.passwords = self.getPassword().splitlines()
@@ -119,9 +108,9 @@ class XFileSharingPro(SimpleHoster):
self.req.http.c.setopt(FOLLOWLOCATION, 1)
location = None
- found = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
- if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)):
- location = found.group(1).strip()
+ m = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
+ if m and re.match(self.LINK_PATTERN, m.group(1)):
+ location = m.group(1).strip()
return location
@@ -140,12 +129,12 @@ class XFileSharingPro(SimpleHoster):
self.header = self.req.http.header
self.req.http.c.setopt(FOLLOWLOCATION, 1)
- found = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
- if found:
+ m = re.search(r"Location\s*:\s*(.*)", self.header, re.I)
+ if m:
break
- found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
+ m = re.search(self.LINK_PATTERN, self.html, re.S)
+ if m:
break
else:
@@ -154,14 +143,14 @@ class XFileSharingPro(SimpleHoster):
else:
self.fail("Download link not found")
- return found.group(1)
+ return m.group(1)
def handlePremium(self):
self.html = self.load(self.pyfile.url, post=self.getPostParameters())
- found = re.search(self.DIRECT_LINK_PATTERN, self.html)
- if not found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError('DIRECT LINK')
- self.startDownload(found.group(1))
+ self.startDownload(m.group(1))
def handleOverriden(self):
#only tested with easybytez.com
@@ -190,10 +179,10 @@ class XFileSharingPro(SimpleHoster):
self.fail(inputs['st'])
#get easybytez.com link for uploaded file
- found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html)
- if not found:
+ m = re.search(self.OVR_LINK_PATTERN, self.html)
+ if m is None:
self.parseError('DIRECT LINK (OVR)')
- self.pyfile.url = found.group(1)
+ self.pyfile.url = m.group(1)
header = self.load(self.pyfile.url, just_header=True)
if 'location' in header: # Direct link
self.startDownload(self.pyfile.url)
@@ -208,14 +197,14 @@ class XFileSharingPro(SimpleHoster):
self.download(link, disposition=True)
def checkErrors(self):
- found = re.search(self.ERROR_PATTERN, self.html)
- if found:
- self.errmsg = found.group(1)
+ m = re.search(self.ERROR_PATTERN, self.html)
+ if m:
+ self.errmsg = m.group(1)
self.logWarning(re.sub(r"<.*?>", " ", self.errmsg))
if 'wait' in self.errmsg:
wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in
- re.findall(r'(\d+)\s*(hour|minute|second)?', self.errmsg)])
+ re.findall(r'(\d+)\s*(hour|minute|second)', self.errmsg)])
self.wait(wait_time, True)
elif 'captcha' in self.errmsg:
self.invalidCaptcha()
@@ -258,7 +247,7 @@ class XFileSharingPro(SimpleHoster):
self.logDebug(self.HOSTER_NAME, inputs)
- if 'op' in inputs and inputs['op'] in ('download2', 'download3'):
+ if 'op' in inputs and inputs['op'] in ("download2", "download3"):
if "password" in inputs:
if self.passwords:
inputs['password'] = self.passwords.pop(0)
@@ -266,9 +255,9 @@ class XFileSharingPro(SimpleHoster):
self.fail("No or invalid passport")
if not self.premium:
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- wait_time = int(found.group(1)) + 1
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ wait_time = int(m.group(1)) + 1
self.setWait(wait_time, False)
else:
wait_time = 0
@@ -300,32 +289,32 @@ class XFileSharingPro(SimpleHoster):
self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN'))
def handleCaptcha(self, inputs):
- found = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
- if found:
- recaptcha_key = unquote(found.group(1))
+ m = re.search(self.RECAPTCHA_URL_PATTERN, self.html)
+ if m:
+ recaptcha_key = unquote(m.group(1))
self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key)
recaptcha = ReCaptcha(self)
inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key)
return 1
else:
- found = re.search(self.CAPTCHA_URL_PATTERN, self.html)
- if found:
- captcha_url = found.group(1)
+ m = re.search(self.CAPTCHA_URL_PATTERN, self.html)
+ if m:
+ captcha_url = m.group(1)
inputs['code'] = self.decryptCaptcha(captcha_url)
return 2
else:
- found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL)
- if found:
- captcha_div = found.group(1)
+ m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL)
+ if m:
+ captcha_div = m.group(1)
self.logDebug(captcha_div)
numerals = re.findall(r'<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))])
self.logDebug("CAPTCHA", inputs['code'], numerals)
return 3
else:
- found = re.search(self.SOLVEMEDIA_PATTERN, self.html)
- if found:
- captcha_key = found.group(1)
+ m = re.search(self.SOLVEMEDIA_PATTERN, self.html)
+ if m:
+ captcha_key = m.group(1)
captcha = SolveMedia(self)
inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key)
return 4
diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py
index 0f0371f21..3e002a0bb 100644
--- a/module/plugins/hoster/XHamsterCom.py
+++ b/module/plugins/hoster/XHamsterCom.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
import re
+
from urllib import unquote
-from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
+from module.plugins.Hoster import Hoster
def clean_json(json_expr):
@@ -18,10 +19,15 @@ def clean_json(json_expr):
class XHamsterCom(Hoster):
__name__ = "XHamsterCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?xhamster\.com/movies/.+'
__version__ = "0.12"
+
+ __pattern__ = r'http://(?:www\.)?xhamster\.com/movies/.+'
__config__ = [("type", ".mp4;.flv", "Preferred type", ".mp4")]
+
__description__ = """XHamster.com hoster plugin"""
+ __author_name__ = None
+ __author_mail__ = None
+
def process(self, pyfile):
self.pyfile = pyfile
@@ -42,25 +48,25 @@ class XHamsterCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
flashvar_pattern = re.compile('flashvars = ({.*?});', re.DOTALL)
json_flashvar = flashvar_pattern.search(self.html)
- if json_flashvar is None:
+ if not json_flashvar:
self.fail("Parse error (flashvars)")
j = clean_json(json_flashvar.group(1))
flashvars = json_loads(j)
- if flashvars["srv"]:
- srv_url = flashvars["srv"] + '/'
+ if flashvars['srv']:
+ srv_url = flashvars['srv'] + '/'
else:
self.fail("Parse error (srv_url)")
- if flashvars["url_mode"]:
- url_mode = flashvars["url_mode"]
+ if flashvars['url_mode']:
+ url_mode = flashvars['url_mode']
else:
self.fail("Parse error (url_mode)")
@@ -72,8 +78,8 @@ class XHamsterCom(Hoster):
long_url = srv_url + file_url
self.logDebug("long_url: %s" % long_url)
else:
- if flashvars["file"]:
- file_url = unquote(flashvars["file"])
+ if flashvars['file']:
+ file_url = unquote(flashvars['file'])
else:
self.fail("Parse error (file_url)")
@@ -87,29 +93,29 @@ class XHamsterCom(Hoster):
return long_url
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
- file_name_pattern = r"<title>(.*?) - xHamster\.com</title>"
- file_name = re.search(file_name_pattern, self.html)
- if file_name is None:
- file_name_pattern = r"<h1 >(.*)</h1>"
- file_name = re.search(file_name_pattern, self.html)
- if file_name is None:
- file_name_pattern = r"http://[www.]+xhamster\.com/movies/.*/(.*?)\.html?"
- file_name = re.match(file_name_pattern, self.pyfile.url)
- if file_name is None:
- file_name_pattern = r"<div id=\"element_str_id\" style=\"display:none;\">(.*)</div>"
- file_name = re.search(file_name_pattern, self.html)
- if file_name is None:
+ pattern = r"<title>(.*?) - xHamster\.com</title>"
+ name = re.search(pattern, self.html)
+ if name is None:
+ pattern = r"<h1 >(.*)</h1>"
+ name = re.search(pattern, self.html)
+ if name is None:
+ pattern = r"http://[www.]+xhamster\.com/movies/.*/(.*?)\.html?"
+ name = re.match(file_name_pattern, self.pyfile.url)
+ if name is None:
+ pattern = r"<div id=\"element_str_id\" style=\"display:none;\">(.*)</div>"
+ name = re.search(pattern, self.html)
+ if name is None:
return "Unknown"
- return file_name.group(1)
+ return name.group(1)
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r"(.*Video not found.*)", self.html) is not None:
return False
diff --git a/module/plugins/hoster/XVideosCom.py b/module/plugins/hoster/XVideosCom.py
index b2fa5243f..4f2611740 100644
--- a/module/plugins/hoster/XVideosCom.py
+++ b/module/plugins/hoster/XVideosCom.py
@@ -1,18 +1,23 @@
# -*- coding: utf-8 -*-
import re
-import urllib
+
+from urllib import unquote
from module.plugins.Hoster import Hoster
class XVideosCom(Hoster):
__name__ = "XVideos.com"
+ __type__ = "hoster"
__version__ = "0.1"
+
__pattern__ = r'http://(?:www\.)?xvideos\.com/video([0-9]+)/.*'
+
__description__ = """XVideos.com hoster plugin"""
- __author_name__ = ""
- __author_mail__ = ""
+ __author_name__ = None
+ __author_mail__ = None
+
def process(self, pyfile):
site = self.load(pyfile.url)
@@ -20,4 +25,4 @@ class XVideosCom(Hoster):
re.search(r"<h2>([^<]+)<span", site).group(1),
re.match(self.__pattern__, pyfile.url).group(1),
)
- self.download(urllib.unquote(re.search(r"flv_url=([^&]+)&", site).group(1)))
+ self.download(unquote(re.search(r"flv_url=([^&]+)&", site).group(1)))
diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py
index 53f61836b..a26e239ad 100644
--- a/module/plugins/hoster/Xdcc.py
+++ b/module/plugins/hoster/Xdcc.py
@@ -1,48 +1,33 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: jeix
-"""
-
-from os.path import join
-from os.path import exists
-from os import makedirs
import re
-import sys
-import time
import socket
import struct
+import sys
+import time
+
+from os import makedirs
+from os.path import exists, join
from select import select
-from module.utils import save_join
from module.plugins.Hoster import Hoster
+from module.utils import save_join
class Xdcc(Hoster):
__name__ = "Xdcc"
- __version__ = "0.32"
- __pattern__ = r'xdcc://([^/]*?)(/#?.*?)?/.*?/#?\d+/?' # xdcc://irc.Abjects.net/#channel/[XDCC]|Shit/#0004/
__type__ = "hoster"
+ __version__ = "0.32"
+
__config__ = [("nick", "str", "Nickname", "pyload"),
("ident", "str", "Ident", "pyloadident"),
("realname", "str", "Realname", "pyloadreal")]
+
__description__ = """Download from IRC XDCC bot"""
__author_name__ = "jeix"
__author_mail__ = "jeix@hasnomail.com"
+
def setup(self):
self.debug = 0 # 0,1,2
self.timeout = 30
@@ -64,7 +49,7 @@ class Xdcc(Hoster):
else:
errno = e.args[0]
- if errno in (10054,):
+ if errno == 10054:
self.logDebug("XDCC: Server blocked our ip, retry in 5 min")
self.setWait(300)
self.wait()
@@ -77,11 +62,6 @@ class Xdcc(Hoster):
def doDownload(self, url):
self.pyfile.setStatus("waiting") # real link
- download_folder = self.config['general']['download_folder']
- location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding()))
- if not exists(location):
- makedirs(location)
-
m = re.match(r'xdcc://(.*?)/#?(.*?)/(.*?)/#?(\d+)/?', url)
server = m.group(1)
chan = m.group(2)
@@ -168,31 +148,31 @@ class Xdcc(Hoster):
"text": msg[3][1:]
}
- if nick == msg["target"][0:len(nick)] and "PRIVMSG" == msg["action"]:
- if msg["text"] == "\x01VERSION\x01":
+ if nick == msg['target'][0:len(nick)] and "PRIVMSG" == msg['action']:
+ if msg['text'] == "\x01VERSION\x01":
self.logDebug("XDCC: Sending CTCP VERSION.")
sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface"))
- elif msg["text"] == "\x01TIME\x01":
+ elif msg['text'] == "\x01TIME\x01":
self.logDebug("Sending CTCP TIME.")
sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time()))
- elif msg["text"] == "\x01LAG\x01":
+ elif msg['text'] == "\x01LAG\x01":
pass # don't know how to answer
- if not (bot == msg["origin"][0:len(bot)]
- and nick == msg["target"][0:len(nick)]
- and msg["action"] in ("PRIVMSG", "NOTICE")):
+ if not (bot == msg['origin'][0:len(bot)]
+ and nick == msg['target'][0:len(nick)]
+ and msg['action'] in ("PRIVMSG", "NOTICE")):
continue
if self.debug is 1:
- print "%s: %s" % (msg["origin"], msg["text"])
+ print "%s: %s" % (msg['origin'], msg['text'])
- if "You already requested that pack" in msg["text"]:
+ if "You already requested that pack" in msg['text']:
retry = time.time() + 300
- if "you must be on a known channel to request a pack" in msg["text"]:
+ if "you must be on a known channel to request a pack" in msg['text']:
self.fail("Wrong channel")
- m = re.match('\x01DCC SEND (.*?) (\d+) (\d+)(?: (\d+))?\x01', msg["text"])
+ m = re.match('\x01DCC SEND (.*?) (\d+) (\d+)(?: (\d+))?\x01', msg['text'])
if m:
done = True
@@ -205,7 +185,10 @@ class Xdcc(Hoster):
self.req.filesize = int(m.group(4))
self.pyfile.name = packname
- filename = save_join(location, packname)
+
+ download_folder = self.config['general']['download_folder']
+ filename = save_join(download_folder, packname)
+
self.logInfo("XDCC: Downloading %s from %s:%d" % (packname, ip, port))
self.pyfile.setStatus("downloading")
diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py
index e51937924..c6c285367 100644
--- a/module/plugins/hoster/YibaishiwuCom.py
+++ b/module/plugins/hoster/YibaishiwuCom.py
@@ -1,53 +1,47 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
from module.common.json_layer import json_loads
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class YibaishiwuCom(SimpleHoster):
__name__ = "YibaishiwuCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?(?:u\.)?115.com/file/(?P<ID>\w+)'
__version__ = "0.12"
+
+ __pattern__ = r'http://(?:www\.)?(?:u\.)?115.com/file/(?P<ID>\w+)'
+
__description__ = """115.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
FILE_NAME_PATTERN = r"file_name: '(?P<N>[^']+)'"
FILE_SIZE_PATTERN = r"file_size: '(?P<S>[^']+)'"
- FILE_OFFLINE_PATTERN = ur'<h3><i style="color:red;">哎呀提取码䞍存圚䞍劚搜搜看吧</i></h3>'
+ OFFLINE_PATTERN = ur'<h3><i style="color:red;">哎呀提取码䞍存圚䞍劚搜搜看吧</i></h3>'
+
+ LINK_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)'
- AJAX_URL_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)'
def handleFree(self):
- found = re.search(self.AJAX_URL_PATTERN, self.html)
- if not found:
+ m = re.search(self.LINK_PATTERN, self.html)
+ if m is None:
self.parseError("AJAX URL")
- url = found.group(1)
- self.logDebug(('FREEUSER' if found.group(2) == 'download' else 'GUEST') + ' URL', url)
+ url = m.group(1)
+ self.logDebug(('FREEUSER' if m.group(2) == 'download' else 'GUEST') + ' URL', url)
response = json_loads(self.load("http://115.com" + url, decode=False))
- for mirror in (response['urls'] if 'urls' in response else response['data'] if 'data' in response else []):
+ if "urls" in response:
+ mirrors = response['urls']
+ elif "data" in response:
+ mirrors = response['data']
+ else:
+ mirrors = None
+
+ for mr in mirrors:
try:
- url = mirror['url'].replace('\\', '')
+ url = mr['url'].replace("\\", "")
self.logDebug("Trying URL: " + url)
self.download(url)
break
diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py
index 9dc1dc6e9..23b9b0a20 100644
--- a/module/plugins/hoster/YoupornCom.py
+++ b/module/plugins/hoster/YoupornCom.py
@@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Hoster import Hoster
class YoupornCom(Hoster):
__name__ = "YoupornCom"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?youporn\.com/watch/.+'
__version__ = "0.2"
+
+ __pattern__ = r'http://(?:www\.)?youporn\.com/watch/.+'
+
__description__ = """Youporn.com hoster plugin"""
__author_name__ = "willnix"
__author_mail__ = "willnix@pyload.org"
+
def process(self, pyfile):
self.pyfile = pyfile
@@ -29,14 +33,13 @@ class YoupornCom(Hoster):
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
- if self.html is None:
+ if not self.html:
self.download_html()
- file_url = re.search(r'(http://download\.youporn\.com/download/\d+\?save=1)">', self.html).group(1)
- return file_url
+ return re.search(r'(http://download\.youporn\.com/download/\d+\?save=1)">', self.html).group(1)
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
file_name_pattern = r"<title>(.*) - Free Porn Videos - YouPorn</title>"
@@ -45,7 +48,7 @@ class YoupornCom(Hoster):
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r"(.*invalid video_id.*)", self.html) is not None:
return False
diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py
index c8c5c523c..bdb91819f 100644
--- a/module/plugins/hoster/YourfilesTo.py
+++ b/module/plugins/hoster/YourfilesTo.py
@@ -1,19 +1,24 @@
# -*- coding: utf-8 -*-
import re
-import urllib
+
+from urllib import unquote
+
from module.plugins.Hoster import Hoster
class YourfilesTo(Hoster):
__name__ = "YourfilesTo"
__type__ = "hoster"
- __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+'
__version__ = "0.21"
+
+ __pattern__ = r'(http://)?(?:www\.)?yourfiles\.(to|biz)/\?d=[a-zA-Z0-9]+'
+
__description__ = """Youfiles.to hoster plugin"""
__author_name__ = ("jeix", "skydancer")
__author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de")
+
def process(self, pyfile):
self.pyfile = pyfile
self.prepare()
@@ -31,7 +36,7 @@ class YourfilesTo(Hoster):
self.wait()
def get_waiting_time(self):
- if self.html is None:
+ if not self.html:
self.download_html()
#var zzipitime = 15;
@@ -53,13 +58,13 @@ class YourfilesTo(Hoster):
url = re.search(r"var bla = '(.*?)';", self.html)
if url:
url = url.group(1)
- url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", ""))
+ url = unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", ""))
return url
else:
self.fail("absolute filepath could not be found. offline? ")
def get_file_name(self):
- if self.html is None:
+ if not self.html:
self.download_html()
return re.search("<title>(.*)</title>", self.html).group(1)
@@ -67,7 +72,7 @@ class YourfilesTo(Hoster):
def file_exists(self):
""" returns True or False
"""
- if self.html is None:
+ if not self.html:
self.download_html()
if re.search(r"HTTP Status 404", self.html) is not None:
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index 6505eac1a..5ffef5531 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
+import os
import re
import subprocess
-import os
+
from urllib import unquote
-from module.utils import html_unescape
from module.plugins.Hoster import Hoster
from module.plugins.internal.SimpleHoster import replace_patterns
+from module.utils import html_unescape
def which(program):
@@ -23,7 +24,7 @@ def which(program):
if is_exe(program):
return program
else:
- for path in os.environ["PATH"].split(os.pathsep):
+ for path in os.environ['PATH'].split(os.pathsep):
path = path.strip('"')
exe_file = os.path.join(path, program)
if is_exe(exe_file):
@@ -35,8 +36,9 @@ def which(program):
class YoutubeCom(Hoster):
__name__ = "YoutubeCom"
__type__ = "hoster"
- __pattern__ = r'https?://(?:[^/]*\.)?(?:youtube\.com|youtu\.be)/watch.*?[?&]v=.*'
__version__ = "0.40"
+
+ __pattern__ = r'https?://(?:[^/]*\.)?(?:youtube\.com|youtu\.be)/watch.*?[?&]v=.*'
__config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting", "hd"),
("fmt", "int", "FMT/ITAG Number (5-102, 0 for auto)", 0),
(".mp4", "bool", "Allow .mp4", True),
@@ -44,6 +46,7 @@ class YoutubeCom(Hoster):
(".webm", "bool", "Allow .webm", False),
(".3gp", "bool", "Allow .3gp", False),
("3d", "bool", "Prefer 3D", False)]
+
__description__ = """Youtube.com hoster plugin"""
__author_name__ = ("spoob", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz")
@@ -76,6 +79,7 @@ class YoutubeCom(Hoster):
101: (".webm", 640, 360, 4, True),
102: (".webm", 1280, 720, 8, True)}
+
def setup(self):
self.resumeDownload = self.multiDL = True
@@ -154,7 +158,7 @@ class YoutubeCom(Hoster):
ffmpeg = which("ffmpeg")
if ffmpeg and time:
m, s = time.groups()[1:]
- if not m:
+ if m is None:
m = "0"
pyfile.name += " (starting at %s:%s)" % (m, s)
diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py
index e718f283e..d51a16a80 100644
--- a/module/plugins/hoster/ZDF.py
+++ b/module/plugins/hoster/ZDF.py
@@ -1,22 +1,26 @@
# -*- coding: utf-8 -*-
import re
+
from xml.etree.ElementTree import fromstring
from module.plugins.Hoster import Hoster
-XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i"
-
+# Based on zdfm by Roland Beermann (http://github.com/enkore/zdfm/)
class ZDF(Hoster):
- # Based on zdfm by Roland Beermann
- # http://github.com/enkore/zdfm/
__name__ = "ZDF Mediathek"
+ __type__ = "hoster"
__version__ = "0.8"
+
__pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/[^0-9]*([0-9]+)[^0-9]*'
+
__description__ = """ZDF.de hoster plugin"""
- __author_name__ = ""
- __author_mail__ = ""
+ __author_name__ = None
+ __author_mail__ = None
+
+ XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i"
+
@staticmethod
def video_key(video):
@@ -35,7 +39,7 @@ class ZDF(Hoster):
return int(re.search(r"[^0-9]*([0-9]{4,})[^0-9]*", url).group(1))
def process(self, pyfile):
- xml = fromstring(self.load(XML_API % self.get_id(pyfile.url)))
+ xml = fromstring(self.load(self.XML_API % self.get_id(pyfile.url)))
status = xml.findtext("./status/statuscode")
if status != "ok":
diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py
index d3d67bedc..b6b59b242 100644
--- a/module/plugins/hoster/ZeveraCom.py
+++ b/module/plugins/hoster/ZeveraCom.py
@@ -5,13 +5,16 @@ from module.plugins.Hoster import Hoster
class ZeveraCom(Hoster):
__name__ = "ZeveraCom"
- __version__ = "0.21"
__type__ = "hoster"
+ __version__ = "0.21"
+
__pattern__ = r'http://(?:www\.)?zevera.com/.*'
+
__description__ = """Zevera.com hoster plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def setup(self):
self.resumeDownload = self.multiDL = True
self.chunkLimit = 1
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index b4fa4f8ac..33a672198 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-
-# Test links (random.bin):
+#
+# Test links:
# http://www13.zippyshare.com/v/18665333/file.html
import re
@@ -11,8 +11,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
- __pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)'
__version__ = "0.49"
+
+ __pattern__ = r'(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)'
+
__description__ = """Zippyshare.com hoster plugin"""
__author_name__ = ("spoob", "zoidberg", "stickell", "skylab")
__author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it", "development@sky-lab.de")
@@ -20,9 +22,10 @@ class ZippyshareCom(SimpleHoster):
FILE_NAME_PATTERN = r'<title>Zippyshare\.com - (?P<N>[^<]+)</title>'
FILE_SIZE_PATTERN = r'>Size:</font>\s*<font [^>]*>(?P<S>[0-9.,]+) (?P<U>[kKMG]+)i?B</font><br />'
FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P<N>[^"]+)";'
- FILE_OFFLINE_PATTERN = r'>File does not exist on this server</div>'
+ OFFLINE_PATTERN = r'>File does not exist on this server</div>'
+
+ SH_COOKIES = [(".zippyshare.com", "ziplocale", "en")]
- SH_COOKIES = [('zippyshare.com', 'ziplocale', 'en')]
def setup(self):
self.multiDL = True
@@ -48,7 +51,7 @@ class ZippyshareCom(SimpleHoster):
# checksum = eval(re.search("((\d*)\s\%\s(\d*)\s\+\s(\d*)\s\%\s(\d*))", self.html).group(0))
m = re.search(r"((?P<a>\d*)\s%\s(?P<b>\d*)\s\+\s(?P<c>\d*)\s%\s(?P<k>\d*))", self.html)
- if not m:
+ if m is None:
self.parseError("Unable to detect values to calculate direct link")
a = int(m.group("a"))
b = int(m.group("b"))
diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py
index 0ecc11f06..d1d1a09cb 100644
--- a/module/plugins/internal/AbstractExtractor.py
+++ b/module/plugins/internal/AbstractExtractor.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
-
class ArchiveError(Exception):
pass
@@ -14,9 +13,14 @@ class WrongPassword(Exception):
class AbtractExtractor:
-
+ __name__ = "AbtractExtractor"
__version__ = "0.1"
+ __description__ = """Abtract extractor plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
@staticmethod
def checkDeps():
""" Check if system statisfy dependencies
diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py
index 400484d26..b247ba654 100644
--- a/module/plugins/internal/CaptchaService.py
+++ b/module/plugins/internal/CaptchaService.py
@@ -1,45 +1,36 @@
# -*- coding: utf-8 -*-
-"""
- 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.
+import re
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
+from random import random
- @author: zoidberg
-"""
-import re
-from random import random
+class CaptchaService:
+ __name__ = "CaptchaService"
+ __version__ = "0.05"
+ __description__ = """Captcha service plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
-class CaptchaService():
- __version__ = "0.04"
def __init__(self, plugin):
self.plugin = plugin
-class ReCaptcha():
+class ReCaptcha:
RECAPTCHA_KEY_PATTERN = r"https?://(?:www\.)?google\.com/recaptcha/api/challenge\?k=(?P<key>\w+)"
RECAPTCHA_KEY_AJAX_PATTERN = r"Recaptcha\.create\s*\(\s*[\"'](?P<key>\w+)[\"']\s*,"
recaptcha_key = None
+
def __init__(self, plugin):
self.plugin = plugin
def detect_key(self, html):
m = re.search(self.RECAPTCHA_KEY_PATTERN, html)
- if not m:
+ if m is None:
m = re.search(self.RECAPTCHA_KEY_AJAX_PATTERN, html)
if m:
self.recaptcha_key = m.group('key')
@@ -48,9 +39,9 @@ class ReCaptcha():
return None
def challenge(self, key=None):
- if not key and self.recaptcha_key:
+ if key is None and self.recaptcha_key:
key = self.recaptcha_key
- elif not (key or self.recaptcha_key):
+ else:
raise TypeError("ReCaptcha key not found")
js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={"k": key}, cookies=True)
@@ -70,6 +61,7 @@ class ReCaptcha():
class AdsCaptcha(CaptchaService):
+
def challenge(self, src):
js = self.plugin.req.load(src, cookies=True)
@@ -88,8 +80,6 @@ class AdsCaptcha(CaptchaService):
class SolveMedia(CaptchaService):
- def __init__(self, plugin):
- self.plugin = plugin
def challenge(self, src):
html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.noscript?k=%s" % src, cookies=True)
diff --git a/module/plugins/internal/DeadCrypter.py b/module/plugins/internal/DeadCrypter.py
index 10eccb9bd..296de739d 100644
--- a/module/plugins/internal/DeadCrypter.py
+++ b/module/plugins/internal/DeadCrypter.py
@@ -6,11 +6,14 @@ from module.plugins.Crypter import Crypter as _Crypter
class DeadCrypter(_Crypter):
__name__ = "DeadCrypter"
__type__ = "crypter"
- __pattern__ = None
__version__ = "0.01"
+
+ __pattern__ = None
+
__description__ = """Crypter is no longer available"""
__author_name__ = "stickell"
__author_mail__ = "l.stickell@yahoo.it"
+
def setup(self):
self.fail("Crypter is no longer available")
diff --git a/module/plugins/internal/DeadHoster.py b/module/plugins/internal/DeadHoster.py
index 201835e2b..35a948824 100644
--- a/module/plugins/internal/DeadHoster.py
+++ b/module/plugins/internal/DeadHoster.py
@@ -4,19 +4,24 @@ from module.plugins.Hoster import Hoster as _Hoster
def create_getInfo(plugin):
+
def getInfo(urls):
yield [('#N/A: ' + url, 0, 1, url) for url in urls]
+
return getInfo
class DeadHoster(_Hoster):
__name__ = "DeadHoster"
__type__ = "hoster"
- __pattern__ = None
__version__ = "0.11"
+
+ __pattern__ = None
+
__description__ = """Hoster is no longer available"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
+
def setup(self):
self.fail("Hoster is no longer available")
diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py
index ec80116d6..6bcad293c 100644
--- a/module/plugins/internal/MultiHoster.py
+++ b/module/plugins/internal/MultiHoster.py
@@ -2,16 +2,18 @@
import re
-from module.utils import remove_chars
from module.plugins.Hook import Hook
+from module.utils import remove_chars
class MultiHoster(Hook):
- """
- Generic MultiHoster plugin
- """
+ __name__ = "MultiHoster"
+ __type__ = "hook"
+ __version__ = "0.20"
- __version__ = "0.20"
+ __description__ = """Generic MultiHoster plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
replacements = [("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"),
("ifile.it", "filecloud.io"), ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"),
@@ -20,6 +22,7 @@ class MultiHoster(Hook):
ignored = []
interval = 24 * 60 * 60 #: reload hosters daily
+
def setup(self):
self.hosters = []
self.supported = []
@@ -139,8 +142,8 @@ class MultiHoster(Hook):
self.logDebug("Overwritten Hosters: %s" % ", ".join(sorted(self.supported)))
for hoster in self.supported:
dict = self.core.pluginManager.hosterPlugins[hoster]
- dict["new_module"] = module
- dict["new_name"] = self.__name__
+ dict['new_module'] = module
+ dict['new_name'] = self.__name__
if excludedList:
self.logInfo("The following hosters were not overwritten - account exists: %s" % ", ".join(sorted(excludedList)))
@@ -156,17 +159,17 @@ class MultiHoster(Hook):
self.logDebug("Regexp: %s" % regexp)
dict = self.core.pluginManager.hosterPlugins[self.__name__]
- dict["pattern"] = regexp
- dict["re"] = re.compile(regexp)
+ dict['pattern'] = regexp
+ dict['re'] = re.compile(regexp)
def unloadHoster(self, hoster):
dict = self.core.pluginManager.hosterPlugins[hoster]
if "module" in dict:
- del dict["module"]
+ del dict['module']
if "new_module" in dict:
- del dict["new_module"]
- del dict["new_name"]
+ del dict['new_module']
+ del dict['new_name']
def unload(self):
"""Remove override for all hosters. Scheduler job is removed by hookmanager"""
@@ -176,8 +179,8 @@ class MultiHoster(Hook):
# reset pattern
klass = getattr(self.core.pluginManager.getPlugin(self.__name__), self.__name__)
dict = self.core.pluginManager.hosterPlugins[self.__name__]
- dict["pattern"] = getattr(klass, '__pattern__', r"^unmatchable$")
- dict["re"] = re.compile(dict["pattern"])
+ dict['pattern'] = getattr(klass, "__pattern__", r'^unmatchable$')
+ dict['re'] = re.compile(dict['pattern'])
def downloadFailed(self, pyfile):
"""remove plugin override if download fails but not if file is offline/temp.offline"""
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index b1a18f5e0..0b99feb42 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -1,65 +1,68 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
from module.plugins.Crypter import Crypter
+from module.plugins.internal.SimpleHoster import PluginParseError, replace_patterns, set_cookies
from module.utils import html_unescape
-from module.plugins.internal.SimpleHoster import replace_patterns
class SimpleCrypter(Crypter):
__name__ = "SimpleCrypter"
- __version__ = "0.07"
- __pattern__ = None
__type__ = "crypter"
+ __version__ = "0.10"
+
+ __pattern__ = None
+
__description__ = """Simple decrypter plugin"""
- __author_name__ = ("stickell", "zoidberg")
- __author_mail__ = ("l.stickell@yahoo.it", "zoidberg@mujmail.cz")
+ __author_name__ = ("stickell", "zoidberg", "Walter Purcaro")
+ __author_mail__ = ("l.stickell@yahoo.it", "zoidberg@mujmail.cz", "vuolter@gmail.com")
+
"""
- These patterns should be defined by each crypter:
+ Following patterns should be defined by each crypter:
- LINK_PATTERN: group(1) must be a download link
- example: <div class="link"><a href="(http://speedload.org/\w+)
+ LINK_PATTERN: group(1) must be a download link or a regex to catch more links
+ example: LINK_PATTERN = r'<div class="link"><a href="(http://speedload.org/\w+)'
+
+ TITLE_PATTERN: (optional) The group defined by 'title' should be the title
+ example: TITLE_PATTERN = r'<title>Files of: (?P<title>[^<]+) folder</title>'
+
+ OFFLINE_PATTERN: (optional) Checks if the file is yet available online
+ example: OFFLINE_PATTERN = r'File (deleted|not found)'
+
+ TEMP_OFFLINE_PATTERN: (optional) Checks if the file is temporarily offline
+ example: TEMP_OFFLINE_PATTERN = r'Server maintainance'
- TITLE_PATTERN: (optional) the group defined by 'title' should be the title
- example: <title>Files of: (?P<title>[^<]+) folder</title>
If it's impossible to extract the links using the LINK_PATTERN only you can override the getLinks method.
If the links are disposed on multiple pages you need to define a pattern:
- PAGES_PATTERN: the group defined by 'pages' must be the total number of pages
+ PAGES_PATTERN: The group defined by 'pages' must be the total number of pages
+ example: PAGES_PATTERN = r'Pages: (?P<pages>\d+)'
and a function:
- loadPage(self, page_n):
- must return the html of the page number 'page_n'
+ loadPage(self, page_n):
+ return the html of the page number 'page_n'
"""
- FILE_URL_REPLACEMENTS = []
+ URL_REPLACEMENTS = []
+
+ SH_COOKIES = True # or False or list of tuples [(domain, name, value)]
+
+
+ def setup(self):
+ if isinstance(self.SH_COOKIES, list):
+ set_cookies(self.req.cj, self.SH_COOKIES)
def decrypt(self, pyfile):
- pyfile.url = replace_patterns(pyfile.url, self.FILE_URL_REPLACEMENTS)
+ pyfile.url = replace_patterns(pyfile.url, self.URL_REPLACEMENTS)
self.html = self.load(pyfile.url, decode=True)
+ self.checkOnline()
+
package_name, folder_name = self.getPackageNameAndFolder()
self.package_links = self.getLinks()
@@ -81,6 +84,12 @@ class SimpleCrypter(Crypter):
"""
return re.findall(self.LINK_PATTERN, self.html)
+ def checkOnline(self):
+ if hasattr(self, "OFFLINE_PATTERN") and re.search(self.OFFLINE_PATTERN, self.html):
+ self.offline()
+ elif hasattr(self, "TEMP_OFFLINE_PATTERN") and re.search(self.TEMP_OFFLINE_PATTERN, self.html):
+ self.tempOffline()
+
def getPackageNameAndFolder(self):
if hasattr(self, 'TITLE_PATTERN'):
m = re.search(self.TITLE_PATTERN, self.html)
@@ -104,3 +113,6 @@ class SimpleCrypter(Crypter):
for p in xrange(2, pages + 1):
self.html = self.loadPage(p)
self.package_links += self.getLinks()
+
+ def parseError(self, msg):
+ raise PluginParseError(msg)
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index f10433e78..ec9cf1b70 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -1,29 +1,14 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-from urlparse import urlparse
import re
+
from time import time
+from urlparse import urlparse
-from module.plugins.Hoster import Hoster
-from module.utils import html_unescape, fixup, parseFileSize
-from module.network.RequestFactory import getURL
from module.network.CookieJar import CookieJar
+from module.network.RequestFactory import getURL
+from module.plugins.Hoster import Hoster
+from module.utils import fixup, html_unescape, parseFileSize
def replace_patterns(string, ruleslist):
@@ -55,7 +40,7 @@ def parseHtmlForm(attr_str, html, input_names=None):
name = parseHtmlTagAttrValue("name", inputtag.group(1))
if name:
value = parseHtmlTagAttrValue("value", inputtag.group(1))
- if value is None:
+ if not value:
inputs[name] = inputtag.group(3) or ''
else:
inputs[name] = value
@@ -98,9 +83,12 @@ def parseFileInfo(self, url='', html=''):
if hasattr(self, "html"):
self.html = html
- if hasattr(self, "FILE_OFFLINE_PATTERN") and re.search(self.FILE_OFFLINE_PATTERN, html):
- # File offline
+ if hasattr(self, "OFFLINE_PATTERN") and re.search(self.OFFLINE_PATTERN, html):
+ info['status'] = 1
+ elif hasattr(self, "FILE_OFFLINE_PATTERN") and re.search(self.FILE_OFFLINE_PATTERN, html): #@TODO: Remove in 0.4.10
info['status'] = 1
+ elif hasattr(self, "TEMP_OFFLINE_PATTERN") and re.search(self.TEMP_OFFLINE_PATTERN, html):
+ info['status'] = 6
else:
online = False
try:
@@ -136,6 +124,7 @@ def parseFileInfo(self, url='', html=''):
def create_getInfo(plugin):
+
def getInfo(urls):
for url in urls:
cj = CookieJar(plugin.__name__)
@@ -153,6 +142,7 @@ def timestamp():
class PluginParseError(Exception):
+
def __init__(self, msg):
Exception.__init__(self)
self.value = 'Parse error (%s) - plugin may be out of date' % msg
@@ -163,31 +153,45 @@ class PluginParseError(Exception):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
- __version__ = "0.33"
- __pattern__ = None
__type__ = "hoster"
+ __version__ = "0.35"
+
+ __pattern__ = None
+
__description__ = """Simple hoster plugin"""
__author_name__ = ("zoidberg", "stickell")
__author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it")
+
"""
- These patterns should be defined by each hoster:
- FILE_INFO_PATTERN = r'(?P<N>file_name) (?P<S>file_size) (?P<U>units)'
- or FILE_NAME_PATTERN = r'(?P<N>file_name)'
- and FILE_SIZE_PATTERN = r'(?P<S>file_size) (?P<U>units)'
- FILE_OFFLINE_PATTERN = r'File (deleted|not found)'
- TEMP_OFFLINE_PATTERN = r'Server maintainance'
-
- You can also define a PREMIUM_ONLY_PATTERN to detect links that can be downloaded only with a premium account.
+ Following patterns should be defined by each hoster:
+
+ FILE_INFO_PATTERN: Name and Size of the file
+ example: FILE_INFO_PATTERN = r'(?P<N>file_name) (?P<S>file_size) (?P<U>size_unit)'
+ or
+ FILE_NAME_PATTERN: Name that will be set for the file
+ example: FILE_NAME_PATTERN = r'(?P<N>file_name)'
+ FILE_SIZE_PATTERN: Size that will be checked for the file
+ example: FILE_SIZE_PATTERN = r'(?P<S>file_size) (?P<U>size_unit)'
+
+ OFFLINE_PATTERN: Checks if the file is yet available online
+ example: OFFLINE_PATTERN = r'File (deleted|not found)'
+
+ TEMP_OFFLINE_PATTERN: Checks if the file is temporarily offline
+ example: TEMP_OFFLINE_PATTERN = r'Server maintainance'
+
+ PREMIUM_ONLY_PATTERN: (optional) Checks if the file can be downloaded only with a premium account
+ example: PREMIUM_ONLY_PATTERN = r'Premium account required'
"""
- FILE_SIZE_REPLACEMENTS = []
FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup)]
+ FILE_SIZE_REPLACEMENTS = []
FILE_URL_REPLACEMENTS = []
SH_BROKEN_ENCODING = False # Set to True or encoding name if encoding in http header is not correct
SH_COOKIES = True # or False or list of tuples [(domain, name, value)]
SH_CHECK_TRAFFIC = False # True = force check traffic left for a premium account
+
def init(self):
self.file_info = {}
@@ -223,13 +227,13 @@ class SimpleHoster(Hoster):
def getFileInfo(self):
self.logDebug("URL: %s" % self.pyfile.url)
- if hasattr(self, "TEMP_OFFLINE_PATTERN") and re.search(self.TEMP_OFFLINE_PATTERN, self.html):
- self.tempOffline()
name, size, status = parseFileInfo(self)[:3]
if status == 1:
self.offline()
+ elif status == 6:
+ self.tempOffline()
elif status != 2:
self.logDebug(self.file_info)
self.parseError('File info')
@@ -274,7 +278,7 @@ class SimpleHoster(Hoster):
return parseHtmlForm(attr_str, self.html, input_names)
def checkTrafficLeft(self):
- traffic = self.account.getAccountInfo(self.user, True)["trafficleft"]
+ traffic = self.account.getAccountInfo(self.user, True)['trafficleft']
if traffic == -1:
return True
size = self.pyfile.size / 1024
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index e3765602b..19c278735 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -1,37 +1,27 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
-"""
-
import os
import re
-from os.path import join
+
from glob import glob
-from subprocess import Popen, PIPE
+from os.path import join
from string import digits
+from subprocess import Popen, PIPE
-from module.utils import save_join, decode
from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPassword, ArchiveError, CRCError
+from module.utils import save_join, decode
class UnRar(AbtractExtractor):
__name__ = "UnRar"
__version__ = "0.16"
+ __description__ = """Rar extractor plugin"""
+ __author_name__ = "RaNaN"
+ __author_mail__ = "RaNaN@pyload.org"
+
+ CMD = "unrar"
+
# there are some more uncovered rar formats
re_version = re.compile(r"(UNRAR 5[\.\d]+(.*?)freeware)")
re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I)
@@ -39,7 +29,7 @@ class UnRar(AbtractExtractor):
re_filelist = re.compile(r"(.+)\s+(\d+)\s+(\d+)\s+")
re_filelist5 = re.compile(r"(.+)\s+(\d+)\s+\d\d-\d\d-\d\d\s+\d\d:\d\d\s+(.+)")
re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)", re.I)
- CMD = "unrar"
+
@staticmethod
def checkDeps():
@@ -200,8 +190,8 @@ class UnRar(AbtractExtractor):
args.append("-y")
# set a password
- if "password" in kwargs and kwargs["password"]:
- args.append("-p%s" % kwargs["password"])
+ if "password" in kwargs and kwargs['password']:
+ args.append("-p%s" % kwargs['password'])
else:
args.append("-p-")
diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py
index 501962442..e339434f9 100644
--- a/module/plugins/internal/UnZip.py
+++ b/module/plugins/internal/UnZip.py
@@ -1,24 +1,7 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: RaNaN
-"""
-
-import zipfile
import sys
+import zipfile
from module.plugins.internal.AbstractExtractor import AbtractExtractor
@@ -27,6 +10,11 @@ class UnZip(AbtractExtractor):
__name__ = "UnZip"
__version__ = "0.1"
+ __description__ = """Zip extractor plugin"""
+ __author_name__ = "RaNaN"
+ __author_mail__ = "RaNaN@pyload.org"
+
+
@staticmethod
def checkDeps():
return sys.version_info[:2] >= (2, 6)
diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py
index 76aff54f0..5c0bfc893 100644
--- a/module/plugins/internal/XFSPAccount.py
+++ b/module/plugins/internal/XFSPAccount.py
@@ -1,24 +1,9 @@
# -*- coding: utf-8 -*-
-"""
- 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/>.
-
- @author: zoidberg
-"""
-
import re
+
from time import mktime, strptime
+
from module.plugins.Account import Account
from module.plugins.internal.SimpleHoster import parseHtmlForm
from module.utils import parseFileSize
@@ -26,8 +11,9 @@ from module.utils import parseFileSize
class XFSPAccount(Account):
__name__ = "XFSPAccount"
- __version__ = "0.06"
__type__ = "account"
+ __version__ = "0.06"
+
__description__ = """XFileSharingPro base account plugin"""
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
@@ -39,25 +25,26 @@ class XFSPAccount(Account):
LOGIN_FAIL_PATTERN = r'Incorrect Login or Password|>Error<'
PREMIUM_PATTERN = r'>Renew premium<'
+
def loadAccountInfo(self, user, req):
html = req.load(self.MAIN_PAGE + "?op=my_account", decode=True)
validuntil = trafficleft = None
premium = True if re.search(self.PREMIUM_PATTERN, html) else False
- found = re.search(self.VALID_UNTIL_PATTERN, html)
- if found:
+ m = re.search(self.VALID_UNTIL_PATTERN, html)
+ if m:
premium = True
trafficleft = -1
try:
- self.logDebug(found.group(1))
- validuntil = mktime(strptime(found.group(1), "%d %B %Y"))
+ self.logDebug(m.group(1))
+ validuntil = mktime(strptime(m.group(1), "%d %B %Y"))
except Exception, e:
self.logError(e)
else:
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if found:
- trafficleft = found.group(1)
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ if m:
+ trafficleft = m.group(1)
if "Unlimited" in trafficleft:
premium = True
else:
diff --git a/module/plugins/ocr/GigasizeCom.py b/module/plugins/ocr/GigasizeCom.py
index 8f9d78710..ba0b805e6 100644
--- a/module/plugins/ocr/GigasizeCom.py
+++ b/module/plugins/ocr/GigasizeCom.py
@@ -2,7 +2,17 @@
from module.plugins.OCR import OCR
+
class GigasizeCom(OCR):
+ __name__ = "GigasizeCom"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Gigasize.com ocr plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
def __init__(self):
OCR.__init__(self)
@@ -11,10 +21,3 @@ class GigasizeCom(OCR):
self.threshold(2.8)
self.run_tesser(True, False, False, True)
return self.result_captcha
-
-if __name__ == '__main__':
- ocr = GigasizeCom()
- import urllib
- urllib.urlretrieve('http://www.gigasize.com/randomImage.php', "gigasize_tmp.jpg")
-
- print ocr.get_captcha('gigasize_tmp.jpg')
diff --git a/module/plugins/ocr/LinksaveIn.py b/module/plugins/ocr/LinksaveIn.py
index 0ddd50a50..3ae139a4e 100644
--- a/module/plugins/ocr/LinksaveIn.py
+++ b/module/plugins/ocr/LinksaveIn.py
@@ -3,13 +3,20 @@
from module.plugins.OCR import OCR
from PIL import Image
from os import sep
-from os.path import dirname
-from os.path import abspath
+from os.path import abspath, dirname
from glob import glob
class LinksaveIn(OCR):
__name__ = "LinksaveIn"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Linksave.in ocr plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
def __init__(self):
OCR.__init__(self)
self.data_dir = dirname(abspath(__file__)) + sep + "LinksaveIn" + sep
@@ -139,11 +146,3 @@ class LinksaveIn(OCR):
final += self.result_captcha
return final
-
-if __name__ == '__main__':
- import urllib
- ocr = LinksaveIn()
- testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D"
- urllib.urlretrieve(testurl, ocr.data_dir+"captcha.gif")
-
- print ocr.get_captcha(ocr.data_dir+'captcha.gif')
diff --git a/module/plugins/ocr/NetloadIn.py b/module/plugins/ocr/NetloadIn.py
index 9fc2f0725..0de88302e 100644
--- a/module/plugins/ocr/NetloadIn.py
+++ b/module/plugins/ocr/NetloadIn.py
@@ -4,6 +4,14 @@ from module.plugins.OCR import OCR
class NetloadIn(OCR):
__name__ = "NetloadIn"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Netload.in ocr plugin"""
+ __author_name__ = "pyLoad Team"
+ __author_mail__ = "admin@pyload.org"
+
+
def __init__(self):
OCR.__init__(self)
@@ -17,10 +25,3 @@ class NetloadIn(OCR):
self.result_captcha = self.result_captcha.replace(" ", "")[:4] # cut to 4 numbers
return self.result_captcha
-
-if __name__ == '__main__':
- import urllib
- ocr = NetloadIn()
- urllib.urlretrieve("http://netload.in/share/includes/captcha.php", "captcha.png")
-
- print ocr.get_captcha('captcha.png')
diff --git a/module/plugins/ocr/ShareonlineBiz.py b/module/plugins/ocr/ShareonlineBiz.py
index db72449d1..0ad018bf9 100644
--- a/module/plugins/ocr/ShareonlineBiz.py
+++ b/module/plugins/ocr/ShareonlineBiz.py
@@ -1,31 +1,22 @@
# -*- coding: utf-8 -*-
-#
-#Copyright (C) 2009 kingzero, RaNaN
-#
-#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/>.
-#
-###
from module.plugins.OCR import OCR
+
class ShareonlineBiz(OCR):
__name__ = "ShareonlineBiz"
+ __type__ = "ocr"
+ __version__ = "0.1"
+
+ __description__ = """Shareonline.biz ocr plugin"""
+ __author_name__ = "RaNaN"
+ __author_mail__ = "RaNaN@pyload.org"
+
def __init__(self):
OCR.__init__(self)
- def get_captcha(self, image):
+ def get_captcha(self, image):
self.load_image(image)
self.to_greyscale()
self.image = self.image.resize((160, 50))
@@ -45,9 +36,3 @@ class ShareonlineBiz(OCR):
return final
#tesseract at 60%
-
-if __name__ == '__main__':
- import urllib
- ocr = ShareonlineBiz()
- urllib.urlretrieve("http://www.share-online.biz/captcha.php", "captcha.jpeg")
- print ocr.get_captcha('captcha.jpeg')