-
-
Save m42e/408e303355b38cc16b4b8b6b46404eb1 to your computer and use it in GitHub Desktop.
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); |
Thanks for trying but I cannot remember why I had this in the first place :)
its a part of your payload for iOS App to get push notifications: https://apps.apple.com/de/app/pyload-für-ios/id799697539
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.
-
Die Datei pyLoadiOSPush.py in das pyLoad Hooks Verzeichnis unter pyload/module/plugin/hooks/ kopieren
-
PyLoad Server neustarten
-
Im Webinterface unter Einstellungen -> Zusatzprogramme -> Menu -> pyLoadiOSPush die gewünschten Einstellungen vornehmen und als "Device Key" xxx eintragen
Sorry not my app :)
sorry, I mixed up something
I used this once maybe that’s the reason
does the script work? I get the following message in the payload log:
INFO | ADDON PyLoadiOSPush: Response: Failed to connect: 0