File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -553,12 +553,16 @@ def add_drive_clip():
553553 description = request .form .get ('description' , '' ).strip ()
554554
555555 def extract_drive_id (link ):
556+ # Accept both full share URLs and raw file IDs
556557 match = re .search (r'/d/([a-zA-Z0-9_-]+)' , link )
557558 if match :
558559 return match .group (1 )
559560 match = re .search (r'id=([a-zA-Z0-9_-]+)' , link )
560561 if match :
561562 return match .group (1 )
563+ # Fallback: raw ID
564+ if re .match (r'^[a-zA-Z0-9_-]{10,}$' , link ):
565+ return link
562566 return None
563567
564568 file_id = extract_drive_id (link )
@@ -577,6 +581,7 @@ def extract_drive_id(link):
577581
578582 return render_template ('add_drive_clip.html' , message = message )
579583
584+
580585# --- Print routes for debugging (optional, can comment out) ---
581586for rule in app .url_map .iter_rules ():
582587 print (rule .endpoint , rule )
You can’t perform that action at this time.
0 commit comments