Giter VIP home page Giter VIP logo

pytraffmonetizer's Introduction

Traff Monetizer API

UNOFFICIAL Python bindings for Traff Monetizer Dashboard API

Installation

pip install pyTraffMonetizer

Usage


Login with email and password:

from pyTraffMonetizer import TraffMonetizer

# Your TraffMonetizer login email and password
EMAIL = ""
PASSWORD = ""
g_captcha_response = "" # I haven't figured out how to use this (so this function is actually unusable)

# Initialise the TraffMonetizer object
user = TraffMonetizer()

# Optionally, when instantiating you can pass in the following attributes to the TraffMonetizer class:
Attribute Description Default Value
API_BASE_URL The API BASE URL https://data.traffmonetizer.com
API_PREFIX The API PREFIX /api
API_VERSION The API VERSION ""
# Call the complete_login_flow method to login and set the JWT in self.jwt
user.complete_login_flow(USERNAME, PASSWORD, g_captcha_response)

Add proxies for future requests:

from pyTraffMonetizer import TraffMonetizer

# With authentication & protocol
user.set_proxy("ip:port:username:password", "socks5")

# Without authentication & protocol
user.set_proxy("ip:port", "socks5")

# Alternative way
user.set_socks5_proxy("ip:port")
user.set_socks5_proxy("ip:port:username:password")
user.set_https_proxy("ip:port")
user.set_https_proxy("ip:port:username:password")

Functions


  1. Get user balance

    # Get balance and traffic sold as shown on the dashboard.
    user.get_balance()

  1. Remove a proxy

    # Removes a proxy for future requests.
    user.remove_proxy()

  1. Get all the devices

    # Get all the devices (with earnings)
    user.get_earnings_by_devices()

  1. Payout history

    # Get payout history
    user.get_payout_history()

  1. Is Logged In

    # Check if you're logged in
    user.is_logged_in()

  1. Logout

    # Logged out
    user.logout()

  1. Set JWT Token

    # Set JWT Token if you have one (otherwise use the login())
    user.set_jwt_token(TOKEN)

Exceptions

  • The following exceptions are defined.
    Exception Reason
    NotLoggedInError Raised when you try to access protected routes (dashboard, payout history, etc).

Liked my work?


Consider donating:

  • BTC: bc1qu98aj9etma5l64lcfldweua7w8gnjzets05v6p

  • LTC: LiTzM41bD1ewPAjFxcGyNDZXFYXqUS9fXK

pytraffmonetizer's People

Contributors

coder-amogh avatar

Watchers

 avatar

pytraffmonetizer's Issues

pyTraffMonetizer.exceptions.NotLoggedInError

Hello,

Could you please help me to have balance of traffmonetizer with python script ?

When I launch the script, I receive this error : pyTraffMonetizer.exceptions.NotLoggedInError

I know that you said this on readme, but you don't say anithing else about resolution.

Thank you for your return.

Doane

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.