Posts: 3
Threads: 1
Joined: May 2020
May-10-2020, 09:36 PM
(This post was last modified: May-10-2020, 11:01 PM by Larz60+.)
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.
Posts: 8,168
Threads: 160
Joined: Sep 2016
May-11-2020, 12:19 PM
(This post was last modified: May-11-2020, 12:19 PM by buran.)
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?
Posts: 3
Threads: 1
Joined: May 2020
May-11-2020, 03:51 PM
(This post was last modified: May-11-2020, 04:02 PM by Aqua22.)
(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()
Posts: 8,168
Threads: 160
Joined: Sep 2016
May-11-2020, 04:19 PM
(This post was last modified: May-11-2020, 04:19 PM by buran.)
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.
Posts: 3
Threads: 1
Joined: May 2020
(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.
Posts: 8,168
Threads: 160
Joined: Sep 2016
May-11-2020, 04:34 PM
(This post was last modified: May-11-2020, 04:34 PM by buran.)
(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.
|