From 551159046db10f1758c9c4f15c2a19112c7160d8 Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Thu, 10 Jul 2025 19:04:34 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Remove=20Google=20Drive=20from=20po?= =?UTF-8?q?ssible=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +---- requirements.txt | 1 - src/downloader/factory.py | 4 ---- src/downloader/google_drive.py | 32 -------------------------------- src/downloader/sources.py | 3 --- 5 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/downloader/google_drive.py diff --git a/README.md b/README.md index 7932c76..3bcc75d 100644 --- a/README.md +++ b/README.md @@ -250,10 +250,7 @@ You can use any of the following methods to build. 5. APKMonk - Supports downloading any available version 1. Link Format - https://www.apkmonk.com/app// 2. Example Link - https://www.apkmonk.com/app// - 6. Google Drive - Supports downloading from Google Drive lint - 1. Link Format - https://drive.google.com/uc? - 2. Example Link - https://drive.google.com/uc?id=1ad44UTghbDty8o36Nrp3ZMyUzkPckIqY - 7. APKEEP - Support downloading using [APKEEP](https://github.com/EFForg/apkeep) + 6. APKEEP - Support downloading using [APKEEP](https://github.com/EFForg/apkeep) 1. Link Format - apkeep 2. Example Link - apkeep Note - You need to provide APKEEP_EMAIL and APKEEP_TOKEN in the **DOCKER_PY_REVANCED_SECRETS** Github Secrets. diff --git a/requirements.txt b/requirements.txt index b1a37d8..d333557 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ beautifulsoup4==4.13.4 environs==14.1.1 -gdown @ git+https://github.com/nikhilbadyal/gdown google-play-scraper==1.2.7 lastversion==3.5.7 loguru==0.7.3 diff --git a/src/downloader/factory.py b/src/downloader/factory.py index 8e94ca3..8e1e468 100644 --- a/src/downloader/factory.py +++ b/src/downloader/factory.py @@ -8,14 +8,12 @@ from src.downloader.apkpure import ApkPure from src.downloader.apksos import ApkSos from src.downloader.download import Downloader from src.downloader.github import Github -from src.downloader.google_drive import GoogleDrive from src.downloader.sources import ( APK_MIRROR_BASE_URL, APK_MONK_BASE_URL, APK_PURE_BASE_URL, APKEEP, APKS_SOS_BASE_URL, - DRIVE_DOWNLOAD_BASE_URL, GITHUB_BASE_URL, UPTODOWN_SUFFIX, ) @@ -47,8 +45,6 @@ class DownloaderFactory(object): return ApkMirror(config) if apk_source.startswith(APK_MONK_BASE_URL): return ApkMonk(config) - if apk_source.startswith(DRIVE_DOWNLOAD_BASE_URL): - return GoogleDrive(config) if apk_source.startswith(APKEEP): return Apkeep(config) msg = "No download factory found." diff --git a/src/downloader/google_drive.py b/src/downloader/google_drive.py deleted file mode 100644 index b24fe38..0000000 --- a/src/downloader/google_drive.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Google Drive downloader Class.""" - -from typing import Any, Self - -import gdown - -from src.app import APP -from src.downloader.download import Downloader - - -class GoogleDrive(Downloader): - """Google Driver downloader.""" - - def specific_version(self: Self, app: APP, version: str) -> tuple[str, str]: - """Function to download the specified version of app from apkmirror. - - :param app: Name of the application - :param version: Version of the application to download - :return: Version of downloaded apk - """ - return self.latest_version(app) - - def latest_version(self: Self, app: APP, **kwargs: Any) -> tuple[str, str]: - """Function to download whatever the latest version of app from Google Driver. - - :param app: Name of the application - :return: Version of downloaded apk - """ - url = app.download_source - file_name = f"{self.config.temp_folder_name}/{app.app_name}.apk" - _, download_url = gdown.download(url, quiet=False, use_cookies=False, output=file_name) - return file_name, download_url diff --git a/src/downloader/sources.py b/src/downloader/sources.py index b546d12..ebdcbf8 100644 --- a/src/downloader/sources.py +++ b/src/downloader/sources.py @@ -22,9 +22,6 @@ APK_MONK_BASE_URL = "https://www.apkmonk.com" APKEEP = "apkeep" APK_MONK_APK_URL = APK_MONK_BASE_URL + "/app/{}/" APK_MONK_ICON_URL = "https://cdn.apkmonk.com/logos/{}" -DRIVE_BASE_URL = "https://drive.google.com" -DRIVE_DOWNLOAD_BASE_URL = f"{DRIVE_BASE_URL}/uc?id=" -DRIVE_DOWNLOAD_URL = DRIVE_DOWNLOAD_BASE_URL + "{}" apk_sources = { "backdrops": f"{APK_MIRROR_BASE_APK_URL}/backdrops/backdrops-wallpapers/", "bacon": f"{APK_MIRROR_BASE_APK_URL}/onelouder-apps/baconreader-for-reddit/",