Git Product home page Git Product logo

ptorr-api's Introduction

Welcome to PTORR-API, a RESTful API for torrents!

NOTE: This Project is just for educational purpose (of mine), It doesn't encourage the pirated content avaiable on the internet!

INDEX

Hosting the API locally:

NOTE: To replicate, you will need CREDENTIALS. Go get yours at by signing up here (If you need help with this step, feel free to ask for help in our Support Server

  • Clone this repo using git clone
  • cd into the bot folder.
  • Add the token in a .env file in the project root as follows:
UNAME=<your username>
PSWRD=<your password>
  • Install the pipenv via pip install pipenv and then run:
pipenv install
  • Enjoy!
  • You may do bug-reporting or ask for help in on the SupportServer... or just open an issue on this repo.

How to set up the development environment

Requirements:

  • git
  • pip
  • python 3.8.6 or higher
  1. Fork and clone the repository with git clone https://github.com/<your-username>/ptorr-api

  2. Get to the clone directory using the command cd ptorr-api

  3. Copy the contents of the .env.sample file into a new file - .env and add your DISCORD bot token in there.

  4. Now follow these steps

    (Requires pipenv) - Install pipenv
    - Run pipenv sync --dev to install project dependencies and development dependencies
    - Run pipenv run start to run the bot.
    - For downloading more libraries, use pipenv install <package-name>
    - If you're adding any development-dependencies, use-> pipenv install <package-name> --dev\

How to contribute

Before contributing, here is some information that might help your PR (Pull Request) get merged.

Note: For more detailed information about how to contribute, please refere to the CONTRIBUTING.md file.

To contribute changes follow these steps:

Note: Make sure you have been assigned the issue to which you are making a PR. If you make PR before being assigned, It will be labeled invalid and closed without merging.

  1. Add a upstream link to main branch in your cloned repo
git remote add upstream https://github.com/pvcodes/pi_bot.git
  1. Keep your cloned repo upto date by pulling from upstream (this will also avoid any merge conflicts while committing new changes)
git pull upstream master
  1. Create your feature branch
git checkout -b <feature-name>
  1. Commit all the changes
git commit -am "Meaningful commit message"
  1. Push the changes for review
git push origin <branch-name>
  1. Create a PR from our repo on Github.

How to report a bug

Submit an issue on GitHub and add as much information as you can about the bug, with screenshots of inputs to the bot and bot response if possible (if the issue is regarding bugs).

Stack:

  • python 3
  • requests
  • BeautifulSoup4

Methods

Response Object Example:

  • SUCCESS RESPONSE

For /key method
{
   "_status": "OK",
    "result": [
        {
            "id": "torr-id",
            "title": "torr-tile",

        }
    ]
}
For /info method
{
   "_status": "OK",
    "result": [
        {
            "title": "torr-tile",
            "size": "torr-size",
            "imdb": "torr's imdb link",
            "plot" : "torr's plot",
            "director":[],
            "writer":[],
            "cast":[]
        }
    ]
}
  • ERROR RESPONSE

{
   "_status": "ERROR",
    "result": [
       "message" : "Error Message"
    ]
}

➮ Get Torrs :

Returns json data containing the torr id's and title's.

  • URL

    /key=keyword&maxCount=max_reponse_object

  • Method:

    GET

  • URL Params

    Required:

    keyword=[string] or k=[string]

    Optional:

    maxCount=[integer] or mx=[integer]

➮ Get Recent Torrs :

Returns json data containing the torr id's and title's.

  • URL

    /recent or /r

  • Method:

    GET

  • URL Params

    • No Params required.

➮ Get Torrs Info :

Returns json data containing the torr details.

  • URL

    /info or /i

  • Method:

    GET

  • URL Params

    Required

    torr-id=[string]

➮ Download Torr :

Returns a torrent file to

  • URL

    /getorr-torr-id

  • Method:

    GET

  • URL Params

    Required

    torr-id=[string]

  • Example

    Alt Text

MIT license

ptorr-api's People

Contributors

pvcodes avatar

Watchers

 avatar

Forkers

pvcodes

ptorr-api's Issues

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.