Code Monkey home page Code Monkey logo

pbwrap's People

Contributors

kostaskol avatar luois45 avatar mikts avatar yaconsult avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

pbwrap's Issues

โ€œ Bad API request, invalid api_user_keyโ€ error

Code:

from pbwrap import Pastebin
pastebin = Pastebin("my api key (retracted)")
pastebin.authenticate("(retracted)", "(retracted)")
p = pastebin.create_paste(api_paste_code="my paste text")
return p

Error:

Bad API request, invalid api_user_key

No encoding before post when creating from file

Hello

There is no utf-8 encoding done before the POST request, so it creates malformed characters when creating a paste from a file.
If loaded directly from a given string it is possible to encode it beforehand and not having the issue.

self-signed cert causing invalid ssl cert error

suggest option to verify ssl certs

HTTPSConnectionPool(host='pastebin.com', port=443): Max retries exceeded with url: /api/api_login.php (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))

AttributeError: __enter__

`This module always worked perfectly for me in the past but I just tried to use it again and the error above is generated. Perhaps it is due to changes made to python since the module was written? I am using Python 3.9.5.

pb = Pastebin(api_dev_key)
user_id =pb.authenticate(username, password)

This works fine!

paste_url = pb.create_paste('this is a test', api_paste_private=1, api_paste_name='test')
print(paste_url)

When pasting a file, an I/O error is returned when it tries to open the file

with open('test.txt', 'w') as f:
f.write('This is line #1\n')
f.write('This is line #2\n')

paste_url = pb.create_paste_from_file('test.txt', api_paste_private=1, api_paste_name='test')

pbwrap.py", line 180, in create_paste_from_file

with io.open(

AttributeError: enter

print(paste_url)
print('Done')`

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.