isaaczafuta / whatapi Goto Github PK
View Code? Open in Web Editor NEWWhat.cd Python API
Home Page: https://isaac.zafuta.com/whatapi
License: Other
What.cd Python API
Home Page: https://isaac.zafuta.com/whatapi
License: Other
Hi, I was just wondering if this is still being maintained? With the new API changes at RED I'd quite like to amend this to work with them and the new endpoints. However, I notice there are a few outstanding PR's that haven't been reviewed and the last commit was a couple of years ago. If this isn't being maintained anymore, would it be okay if I duplicated the repository and continued it under a new name, giving credit to you and the original module of course?
Cheers,
kittivelae
When I attempt to use a config file on Python 3.6, I get this error:
(my36project) [root@laptop1 redacted]# python finddirs.py
Cookies loaded
Traceback (most recent call last):
File "finddirs.py", line 30, in <module>
apihandle = whatapi.WhatAPI(config_file=config_file, server=server, cookies=cookies)
File "/root/python-scripts/my36project/lib/python3.6/site-packages/whatapi/whatapi.py", line 31, in __init__
config = ConfigParser()
TypeError: 'module' object is not callable
Reproducing the code in interactive mode clarifies that the code is attempting to call the module as a function:
(my36project) [root@laptop1 redacted]# python
Python 3.6.0 (default, Mar 14 2017, 12:24:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import configparser as ConfigParser
>>> config = ConfigParser()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Made some small changes to make this project applicable for any gazelle tracker. Just modify the "gazelle_url" variable to suit your tracker of choice.
--- whatapi/whatapi.py› 2016-12-04 09:46:19.808698086 -0600
+++ ../whatapi.py.modified› 2016-12-04 09:45:43.368387764 -0600
@@ -5,6 +5,7 @@
import requests
import time
•
+gazelle_url = 'https://apollo.rip'
headers = {
'Content-type': 'application/x-www-form-urlencoded',
'Accept-Charset': 'utf-8',
@@ -50,7 +51,7 @@
•
def _login(self):
'''Logs in user'''
- loginpage = 'https://ssl.what.cd/login.php'
+ loginpage = gazelle_url + '/login.php'
data = {'username': self.username,
'password': self.password,
'keeplogged': 1,
@@ -63,7 +64,7 @@
•
def get_torrent(self, torrent_id):
'''Downloads the torrent at torrent_id using the authkey and passkey'''
- torrentpage = 'https://ssl.what.cd/torrents.php'
+ torrentpage = gazelle_url + '/torrents.php'
params = {'action': 'download', 'id': torrent_id}
if self.authkey:
params['authkey'] = self.authkey
@@ -76,13 +77,13 @@
•
def logout(self):
'''Logs out user'''
- logoutpage = 'https://ssl.what.cd/logout.php'
+ logoutpage = gazelle_url + '/logout.php'
params = {'auth': self.authkey}
self.session.get(logoutpage, params=params, allow_redirects=False)
•
def request(self, action, **kwargs):
'''Makes an AJAX request at a given action page'''
- ajaxpage = 'https://ssl.what.cd/ajax.php'
+ ajaxpage = gazelle_url + '/ajax.php'
params = {'action': action}
if self.authkey:
params['auth'] = self.authkey
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.