mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-13 15:19:03 +00:00
Fixed possible crash in api_handler.py
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# Uploads a single torrent file
|
||||
# Works on nyaa.si and sukebei.nyaa.si
|
||||
|
||||
# Consider using api_uploader_v2.py instead
|
||||
# It has a nice command line interface
|
||||
|
||||
import json
|
||||
import requests
|
||||
|
||||
@@ -86,7 +89,7 @@ is_complete : False
|
||||
|
||||
# ######################################## CHANGE HERE ########################################
|
||||
|
||||
url = 'https://nyaa.si/api/upload' # or https://sukebei.nyaa.si/api/upload or http://127.0.0.1:5500/api/upload
|
||||
url = 'https://nyaa.si/api/upload' # or 'https://sukebei.nyaa.si/api/upload' or 'http://127.0.0.1:5500/api/upload'
|
||||
|
||||
# Required
|
||||
username = ''
|
||||
@@ -128,4 +131,4 @@ files = {
|
||||
response = requests.post(url, files=files)
|
||||
json_response = response.json()
|
||||
print(json_response)
|
||||
# A successful request should print {'Success': int(torrent_id)}
|
||||
# A successful request should print {'Success': int(torrent_id)}
|
||||
|
||||
Reference in New Issue
Block a user