#Refactor Code

master
MickSlash 2022-12-14 22:41:34 +00:00
parent 4e498f3c3b
commit 7c73ddaed7
1 changed files with 2 additions and 6 deletions

View File

@ -72,7 +72,7 @@ def apiOneDrive(folderType=None,nameFile=None):
if r.status_code == 200: if r.status_code == 200:
r = r.json() r = r.json()
data = r["folder"]["value"] data = r["folder"]["value"]
if r["next"]: if "next" in r:
while "next" in r: while "next" in r:
nextLink = r["next"] nextLink = r["next"]
r = session.get(f"{apiURL}&next={nextLink}").json() r = session.get(f"{apiURL}&next={nextLink}").json()
@ -100,8 +100,4 @@ def fileFinderDB(nameFile, rawURL, data, counter):
def writeToText(text): def writeToText(text):
with open('link_modificati.txt', 'a', encoding='utf-8') as f: with open('link_modificati.txt', 'a', encoding='utf-8') as f:
f.write(f"{text}\n") f.write(f"{text}\n")
apiOneDrive("MLIF/")