mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Formatted code and added test query to plugin updater
This commit is contained in:
parent
42732d1ea5
commit
ba4aa69173
@ -69,7 +69,8 @@ def printLogo():
|
||||
oColors.standardWhite)
|
||||
print()
|
||||
print()
|
||||
print(" " + oColors.darkMagenta + "by Neocky" + oColors.standardWhite+ " ")
|
||||
print(oColors.brightYellow + " [" + oColors.darkMagenta + "by Neocky" +
|
||||
oColors.brightYellow + "] " + oColors.standardWhite)
|
||||
print()
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import urllib.request
|
||||
import cgi
|
||||
import time
|
||||
import requests
|
||||
import re
|
||||
import requests
|
||||
from consoleoutput import consoleTitle, clearConsole, printMainMenu
|
||||
from plugin_updatechecker import getInstalledPackages
|
||||
|
||||
@ -147,6 +147,7 @@ def searchPackage():
|
||||
print(packageUrl)
|
||||
print(ressourceId)
|
||||
|
||||
|
||||
def downloadLatestVersion(ressourceId, packageDownloadName, sourcePath):
|
||||
url = "https://api.spiget.org/v2/resources/" + ressourceId + "/download"
|
||||
remotefile = urllib.request.urlopen(url)
|
||||
@ -154,6 +155,8 @@ def downloadLatestVersion(ressourceId, packageDownloadName, sourcePath):
|
||||
downloadPath = sourcePath + packageDownloadName
|
||||
urllib.request.urlretrieve(url, downloadPath)
|
||||
filesizeData = calculateFileSize(filesize)
|
||||
print(filesizeData)
|
||||
print(filesize)
|
||||
print(f" Downloadsize: {filesizeData} MB")
|
||||
|
||||
|
||||
@ -170,9 +173,6 @@ def getLatestPackageVersion():
|
||||
downloadLatestVersion(ressourceId, packageDownloadName, downloadPath)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
consoleTitle()
|
||||
inputMainMenu()
|
||||
outputTest()
|
||||
|
@ -1,5 +1,6 @@
|
||||
import os
|
||||
import re
|
||||
import requests
|
||||
|
||||
#from consoleoutput import consoleTitle, clearConsole
|
||||
#from plugin_downloader import handleInput
|
||||
@ -22,6 +23,16 @@ def getInstalledPluginVersion(pluginName):
|
||||
pluginNameOnly = pluginNameOnly[:-1]
|
||||
print(pluginNameOnly)
|
||||
print(pluginVersionString)
|
||||
response = requests.get("https://api.spiget.org/v2/search/resources/" + pluginNameOnly + "?field=name")
|
||||
#https://api.spiget.org/v2/search/resources/luckperms?field=name
|
||||
print("https://api.spiget.org/v2/search/resources/" + pluginNameOnly + "?field=name")
|
||||
packageName = response.json()
|
||||
i = 1
|
||||
for ressource in packageName:
|
||||
pName = ressource["name"]
|
||||
pID = ressource["id"]
|
||||
print(f" [{i}] {pName}")
|
||||
i = i + 1
|
||||
|
||||
# start query
|
||||
# get id
|
||||
|
Loading…
Reference in New Issue
Block a user