chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Pomf.cat Uploader filter_list
Author
Message
Pomf.cat Uploader #1
I've started to familiarize myself with parts of requests other than just .get() recently. Last night was my first venture into the post method, which is easy as hell to use, as always.
Anyway, a cup of coffee and 20 minutes of screwing with an API later, I made this. There's two versions; one runs as a normal python file, asks for input, etc... The other is one I custom built for my context menu tutorial (link). Enjoy!

Version 1:
Code:
from requests import post

r=post(
    url='https://pomf.cat/upload.php',
    files={'files[]':open(raw_input('File to upload: '),'rb')}
).text

for x in eval(r[0]+r[16:])['files']: print 'https://a.pomf.cat/'+x['url']

Version 2:
Code:
from pyperclip import copy
from requests import post
from sys import argv

r=post(
    url='https://pomf.cat/upload.php',
    files={'files[]':open(argv[1],'rb')}
).text

for x in eval(r[0]+r[16:])['files']: copy('https://a.pomf.cat/'+x['url'])

Reply






Users browsing this thread: 1 Guest(s)