Skip to content

Commit

Permalink
Remove DriveApp support
Browse files Browse the repository at this point in the history
- This removes support for cloning, archiving and extracting data from DriveApp
- Fix bug in extracting rar files
  • Loading branch information
l3v11 authored Jun 4, 2022
1 parent 547f6c9 commit da9e9f0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN chmod 777 /usr/src/app

RUN apt-get -qq update && DEBIAN_FRONTEND="noninteractive" \
apt-get -qq install -y locales python3 python3-pip \
libmagic-dev p7zip-full unzip && locale-gen en_US.UTF-8
libmagic-dev p7zip-full p7zip-rar unzip && locale-gen en_US.UTF-8

ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## SearchX

> A simple Telegram Bot for searching data on Google Drive. Able to clone data from Google Drive, AppDrive, DriveApp and GDToT links. Supports MongoDB for storing authorized users record.
> A simple Telegram Bot for searching data on Google Drive. Able to clone data from Google Drive, AppDrive and GDToT. Supports MongoDB for storing authorized users record.
</p>

Expand Down
6 changes: 3 additions & 3 deletions bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def log(update, context):
<br><br>
• <b>/{BotCommands.ListCommand}</b> &lt;query&gt;: Find data on Google Drive
<br><br>
• <b>/{BotCommands.CloneCommand}</b> &lt;url&gt; &lt;key&gt;: Copy data from Google Drive, AppDrive, DriveApp and GDToT (Key optional)
• <b>/{BotCommands.CloneCommand}</b> &lt;url&gt; &lt;key&gt;: Copy data from Google Drive, AppDrive and GDToT (Key optional)
<br><br>
• <b>/{BotCommands.ArchiveCommand}</b>: Archive data from Google Drive, AppDrive, DriveApp and GDToT
• <b>/{BotCommands.ArchiveCommand}</b>: Archive data from Google Drive, AppDrive and GDToT
<br><br>
• <b>/{BotCommands.ExtractCommand}</b>: Extract data from Google Drive, AppDrive, DriveApp and GDToT
• <b>/{BotCommands.ExtractCommand}</b>: Extract data from Google Drive, AppDrive and GDToT
<br><br>
• <b>/{BotCommands.CountCommand}</b> &lt;drive_url&gt;: Count data from Google Drive
<br><br>
Expand Down
4 changes: 0 additions & 4 deletions bot/helper/download_utils/ddl_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ def appdrive(url: str) -> str:
elif 'error' in response and response['error']:
info['error'] = True
info['message'] = response['message']
if urlparse(url).netloc == 'driveapp.in' and not info['error']:
res = client.get(info['gdrive_link'])
drive_link = etree.HTML(res.content).xpath("//a[contains(@class,'btn')]/@href")[0]
info['gdrive_link'] = drive_link
if not info['error']:
return info
else:
Expand Down
2 changes: 1 addition & 1 deletion bot/helper/ext_utils/bot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def is_gdrive_link(url: str):
return "drive.google.com" in url

def is_appdrive_link(url: str):
url = re.match(r'https?://(appdrive|driveapp)\.in/\S+', url)
url = re.match(r'https?://appdrive\.in/\S+', url)
return bool(url)

def is_gdtot_link(url: str):
Expand Down
2 changes: 1 addition & 1 deletion bot/modules/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def cloneNode(update, context):
gd.deleteFile(link)
else:
help_msg = '<b><u>Instructions</u></b>\nSend a link along with command'
help_msg += '\n\n<b><u>Supported Sites</u></b>\n• Google Drive\n• AppDrive\nDriveApp\nGDToT'
help_msg += '\n\n<b><u>Supported Sites</u></b>\n• Google Drive\n• AppDrive\n• GDToT'
help_msg += '\n\n<b><u>Set Destination Drive</u></b>\nAdd &lt;key&gt; after the link'
sendMessage(help_msg, context.bot, update.message)

Expand Down
2 changes: 1 addition & 1 deletion bot/modules/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _compress(bot, message, is_archive=False, is_extract=False, pswd=None):
threading.Thread(target=add_gd_download, args=(link, listener, is_appdrive, appdict, is_gdtot)).start()
else:
help_msg = '<b><u>Instructions</u></b>\nSend a link along with command'
help_msg += '\n\n<b><u>Supported Sites</u></b>\n• Google Drive\n• AppDrive\nDriveApp\nGDToT'
help_msg += '\n\n<b><u>Supported Sites</u></b>\n• Google Drive\n• AppDrive\n• GDToT'
help_msg += '\n\n<b><u>Set Password</u></b>\nAdd "<code>pswd: xxx</code>" after the link'
sendMessage(help_msg, bot, message)

Expand Down

0 comments on commit da9e9f0

Please sign in to comment.