Skip to content

Instantly share code, notes, and snippets.

@m42e
Created June 21, 2016 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m42e/408e303355b38cc16b4b8b6b46404eb1 to your computer and use it in GitHub Desktop.
Save m42e/408e303355b38cc16b4b8b6b46404eb1 to your computer and use it in GitHub Desktop.
PyLoadiOS fix
from module.plugins.internal.Addon import Addon
import httplib, urllib
class PyLoadiOSPush(Addon):
__name__ = "PyLoadiOSPush"
__type__ = "hook"
__version__ = "1.1"
__description__ = "Push for pyLoad for iOS App"
__config__ = [("deviceKey", "str", "Device Keys (comma seperated)", ""),
("pushCaptcha", "bool", "Push Captcha", True),
("pushDlFail", "bool", "Push Download Failed", True),
("pushPackFinish", "bool", "Push Package Finished", True),
("pushAllFinish", "bool", "Push All Packages Finished", True),
("pushUnrarFinish", "bool", "Push Unrar Finished", True),
("activated", "bool", "Activated", True)]
__author_name__ = ("Mathias Nagler")
PUSH_URL = "95.85.62.143"
PUSH_REQUEST = "/pyControlPush/push.php"
event_map = {"coreReady" : "initialize",
"allDownloadsFinished": "allDlFinished",
"unrarFinished": "unrarFinished"}
def initialize(self):
self.log_warning("Initialized pyLoadIOS")
if self.config.get("deviceKey") == "":
self.setConfig("activated",False);
def newCaptchaTask(self, task):
if self.config.get("pushCaptcha") == True:
self.sendNotification("captchaAvail", None);
def downloadFailed(self, pyfile):
if self.config.get("pushDlFail") == True:
self.sendNotification("dlFail", pyfile.name);
def packageFinished(self, pypack):
if self.config.get("pushPackFinish") == True:
self.sendNotification("pkgFinish", pypack.name);
def allDlFinished(self):
self.log_warning("All finished")
if self.config.get("pushAllFinish") == True:
self.sendNotification("allFinish", None);
def unrarFinished(self, folder, fname):
fnamesplit = fname.split("/");
name = fnamesplit[-1];
if self.config.get("pushUnrarFinish") == True:
self.sendNotification("unrarFinish", name);
def sendNotification(self, msg, val):
deviceKeyString = self.config.get("deviceKey");
deviceKeys = deviceKeyString.split(" ");
for deviceKey in deviceKeys:
self.log_info("Pushing notification to device "+deviceKey);
params = urllib.urlencode({'deviceKey': deviceKey, 'msg': msg, 'val': val})
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
conn = httplib.HTTPConnection(self.PUSH_URL)
conn.request("POST", self.PUSH_REQUEST, params, headers)
response = conn.getresponse()
data = response.read()
conn.close()
self.log_info("Response: "+data);
@utcneo
Copy link

utcneo commented Nov 2, 2020

does the script work? I get the following message in the payload log:

INFO | ADDON PyLoadiOSPush: Response: Failed to connect: 0

@m42e
Copy link
Author

m42e commented Nov 2, 2020

Thanks for trying but I cannot remember why I had this in the first place :)

@utcneo
Copy link

utcneo commented Nov 2, 2020

its a part of your payload for iOS App to get push notifications: https://apps.apple.com/de/app/pyload-für-ios/id799697539

@utcneo
Copy link

utcneo commented Nov 2, 2020

Im Anhang dieser Mail befindet sich ein Plugin für pyLoad mit dem Namen pyLoadiOSPush.py. Dieses Plugin muss zu pyLoad hinzugefügt werden und dort eingerichtet werden. Dafür sind folgende Schritte notwendig.

  1. Die Datei pyLoadiOSPush.py in das pyLoad Hooks Verzeichnis unter pyload/module/plugin/hooks/ kopieren

  2. PyLoad Server neustarten

  3. Im Webinterface unter Einstellungen -> Zusatzprogramme -> Menu -> pyLoadiOSPush die gewünschten Einstellungen vornehmen und als "Device Key" xxx eintragen

@m42e
Copy link
Author

m42e commented Nov 2, 2020

Sorry not my app :)

@utcneo
Copy link

utcneo commented Nov 2, 2020

sorry, I mixed up something

@m42e
Copy link
Author

m42e commented Nov 2, 2020

I used this once maybe that’s the reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment