Coder Social home page Coder Social logo

whatapi's People

Contributors

capital-g avatar emjaytee404 avatar gofetch avatar isaaczafuta avatar point-source avatar stevegoossens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatapi's Issues

Is this still being maintained

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

configparser code is wrong for Python 3

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

Make API tracker agnostic

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.