Skip to content

Commit

Permalink
Support dropbox URL
Browse files Browse the repository at this point in the history
  • Loading branch information
okaxaki committed Aug 31, 2024
1 parent 0f77a25 commit 7c08493
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export function toDownloadEndpoint(url: string) {
return `https://raw.githubusercontent.com/${m[1]}/${m[2]}`;
}

// Dropbox Public Share URL
m = url.match(/^(?:https:\/\/)?www.dropbox.com\/(.*)/);
if (m != null) {
return `https://dl.dropboxusercontent.com/${m[1]}`.replace('dl=0', '');
}

// Google Drive Public URL
m = url.match(/^(?:https:\/\/)?drive.google.com\/file\/d\/([A-Za-z0-9_\-]+)/);
if (m != null) {
Expand Down

0 comments on commit 7c08493

Please sign in to comment.