Python Forum
Just a simple vshare.io api script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Just a simple vshare.io api script
#1
Hello there!

Today i wrote a simple python script that uses vshare's api to upload to there platfrom.
If you want to try it out here is a link to download: https://vshare.is/Z36dd9y3o2/vshare_rar (DONT WORRY this was straight uploaded to vshare than copied the link! So it's not an ipgrabber but if you want to be sure you can use a vpn.)
And i can't put the code straight here because it's not just only a python file.

Have a good day or night whenever you are reading this!

I'm a really begginer at coding so i don't know anything.
Reply
#2
It would be better to upload your code to a repo, e.g. on Github. Not many, if anyone, will risk blind download from untrusted source.

Also, you see the contradiction between
(May-10-2020, 09:36 PM)Aqua22 Wrote: i wrote a simple python script

and

(May-10-2020, 09:36 PM)Aqua22 Wrote: And i can't put the code straight here because it's not just only a python file.

what would "not only python file" refer to?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(May-11-2020, 12:19 PM)buran Wrote: It would be better to upload your code to a repo, e.g. on Github. Not many, if anyone, will risk blind download from untrusted source.

Also, you see the contradiction between
(May-10-2020, 09:36 PM)Aqua22 Wrote: i wrote a simple python script

and

(May-10-2020, 09:36 PM)Aqua22 Wrote: And i can't put the code straight here because it's not just only a python file.

what would "not only python file" refer to?

Bassically there's an output text file where the information about the file upload gets insterted and there is a test file to test on

Ok so here is the git repo: https://github.com/EverYT77/vshare-api-u...ith-python

and here is the scirpt:
import requests
import sys

url = 'https://api.vshare.is/upload'

a = input("Please provide the filename with extension to upload to this page: VSHARE\n\n")

files = {'file': open(a, 'rb')}

r = requests.post(url, files=files)
sys.stdout = open("output.txt", "w")
print(r.status_code)
print(r.text)
sys.stdout.close()
Reply
#4
The idea is to upload separate files, not the rar file and track version using git. It's a version control system.

But having the code here is just fine. It's interesting why would you write to file, and not simply print the result? And if you want to save to file, why redirect the stdout instead of writing to file?

final advise - don't use single char names, like a, r, etc.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
(May-11-2020, 04:19 PM)buran Wrote: The idea is to upload separate files, not the rar file and track version using git. It's a version control system.

But having the code here is just fine. It's interesting why would you write to file, and not simply print the result? And if you want to save to file, why redirect the stdout instead of writing to file?

final advise - don't use single char names, like a, r, etc.

I understand that you don't really like the way i done the script and uploded it to github but thats how i can do it.
I don't really understand any programming language and github.
And English is not even my native language.
But thanks for answering i guess.
Reply
#6
(May-11-2020, 04:24 PM)Aqua22 Wrote: you don't really like the way i done the script and uploded it to github
I don't care about your script and how you have done it or do you use git/github repo properly. I guess you share your code in order to get feedback and learn. If you don't want to learn, just say so... I am just giving you some pointers.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple script to find directories containing pictures steve_79 8 6,728 Apr-24-2017, 04:21 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020