Skip to content

Commit

Permalink
Drive leech ✅
Browse files Browse the repository at this point in the history
  • Loading branch information
Aluval authored Sep 13, 2024
1 parent bc4d4bf commit b292e53
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions main/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ async def upload_to_google_drive(file_path, file_name, sts):

return response.get('webViewLink')

#Driveleech
def extract_id_from_driveurl(url):
file_id = None
# Match the different URL patterns for Google Drive links
patterns = [
r'id=([a-zA-Z0-9-_]+)', # Format 1: ?id=FILE_ID
r'/d/([a-zA-Z0-9-_]+)', # Format 2: /d/FILE_ID/
r'/file/d/([a-zA-Z0-9-_]+)' # Format 3: /file/d/FILE_ID/
]

for pattern in patterns:
match = re.search(pattern, url)
if match:
file_id = match.group(1)
break

return file_id


#ALL FILES UPLOADED - CREDITS 🌟 - @Sunrises_24
Expand Down

0 comments on commit b292e53

Please sign in to comment.