Coder Social home page Coder Social logo

s00d / onlinesim-python-api Goto Github PK

View Code? Open in Web Editor NEW
26.0 5.0 17.0 45 KB

Python Wrapper for automatic reception of SMS-messages by onlinesim.ru

Home Page: https://onlinesim.ru

License: Apache License 2.0

Python 98.96% Shell 1.04%
api python onlinesim sms sms-api rent proxy

onlinesim-python-api's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar

onlinesim-python-api's Issues

help me

can u help me to setup on my cpanel and doamin i cannt setup it

Issue for Telegram code request.

In the example to get the code, you specified the following:

multiple driver using

from onlinesimru import Driver

def main():
driver = Driver('YOUR_TOKEN')

tzid = driver.numbers().get('service')
print(tzid)
code = driver.numbers().wait_code(tzid)
print(code)

main()
When receiving SMS from Telegram, this method displays ID messages.
[13464390577]where full SMS is[16042601337] Telegram code 98454
I propose to add an example to receive SMS from a telegram.
from onlinesimru import Driver
def main():
driver = Driver('YOUR_TOKEN')
tzid = driver.numbers().get('service')
print(tzid)
code = driver.numbers().wait_code(tzid=tzid, full_message=True)
code = code.split('Telegram code ')
print(code[1])
main()

Thanks

Problem in installing onlinesim package

I Installed the package and i got this error

image

image

i think it's not installed perfectly

i used this cmd for the installation

$ pip install onlinesimru --upgrade

How do i use it

Ok, i just want to know how i buy a number and then get the code out of it?
The params i need are: the number, the code
Sry if this is a dumb quest ;:D .-.
Thanks in advance

Some Questions / Errors

Hello, thank you for api. I have several questions about how it works ;)

code = driver.numbers().wait_code(tzid=tzid, timeout=60*3)

if sms-message did not received and timeout was expired will raised unexpected error:

File GetNumbers.py line 53. 
 if response['code'] and not not_end and response['code'] != __last_code:
KeyError: 'code'

And can you raise custom exception instead of Exception, because it's hard to resolve it?

File GetNumbers line 49:

   while True:
            time.sleep(timeout)
            counter += 1
            if counter >= 10:
                raise ('Timeout error')                          <-----THIS
            response = self.stateOne(tzid, 1, False)


So through web you can ban bad number after some time.

How can i do it using api?

Thanks!

Async support?

Hi, in the beginning your lib have async features, but you remove it, can i to know why?

GetNumbers.py , close function.

Good day!

Can you implement parameter "ban" for function close?

   GetNumbers.py  line 29
    def close(self, tzid: int):
        return self._get(f'/setOperationOk', {'tzid': tzid})

According documentation you can ban number after 5 min waiting.

Thanks!

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.