Update tabs/resources.py
Browse files- tabs/resources.py +3 -1
tabs/resources.py
CHANGED
|
@@ -172,6 +172,7 @@ def delete_large_files(directory_path, max_size_megabytes):
|
|
| 172 |
print("###################################")
|
| 173 |
|
| 174 |
def download_from_url(url):
|
|
|
|
| 175 |
file_path = find_folder_parent(now_dir, "assets")
|
| 176 |
print(file_path)
|
| 177 |
zips_path = os.path.join(file_path, "assets", "zips")
|
|
@@ -210,7 +211,7 @@ def download_from_url(url):
|
|
| 210 |
os.chdir(zips_path)
|
| 211 |
if "/blob/" in url:
|
| 212 |
url = url.replace("/blob/", "/resolve/")
|
| 213 |
-
|
| 214 |
response = requests.get(url, stream=True)
|
| 215 |
if response.status_code == 200:
|
| 216 |
file_name = url.split("/")[-1]
|
|
@@ -242,6 +243,7 @@ def download_from_url(url):
|
|
| 242 |
if file_id:
|
| 243 |
print("Mega.nz is unsupported due mega.py deprecation")
|
| 244 |
elif "/tree/main" in url:
|
|
|
|
| 245 |
response = requests.get(url)
|
| 246 |
soup = BeautifulSoup(response.content, "html.parser")
|
| 247 |
temp_url = ""
|
|
|
|
| 172 |
print("###################################")
|
| 173 |
|
| 174 |
def download_from_url(url):
|
| 175 |
+
url = url.strip()
|
| 176 |
file_path = find_folder_parent(now_dir, "assets")
|
| 177 |
print(file_path)
|
| 178 |
zips_path = os.path.join(file_path, "assets", "zips")
|
|
|
|
| 211 |
os.chdir(zips_path)
|
| 212 |
if "/blob/" in url:
|
| 213 |
url = url.replace("/blob/", "/resolve/")
|
| 214 |
+
url = url.replace("?download=true", "")
|
| 215 |
response = requests.get(url, stream=True)
|
| 216 |
if response.status_code == 200:
|
| 217 |
file_name = url.split("/")[-1]
|
|
|
|
| 243 |
if file_id:
|
| 244 |
print("Mega.nz is unsupported due mega.py deprecation")
|
| 245 |
elif "/tree/main" in url:
|
| 246 |
+
url = url.replace("?download=true", "")
|
| 247 |
response = requests.get(url)
|
| 248 |
soup = BeautifulSoup(response.content, "html.parser")
|
| 249 |
temp_url = ""
|