Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions experiments/test-gdrive-download.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Test script to verify Google Drive URL conversion and downloading
import { convertGoogleDriveUrl } from '../src/lib.js';
import fetch from 'node-fetch';

const testUrls = [
'https://drive.google.com/file/d/1Cxkx6-428EQAX0-eiaq66H829ohnPp7q/view',
'https://drive.google.com/file/d/1Cxkx6-428EQAX0-eiaq66H829ohnPp7q',
'https://drive.google.com/file/d/1fgJaftjv53xCN7vgiJOaQlbfWkUqPgyd/view',
'https://drive.google.com/file/d/1fgJaftjv53xCN7vgiJOaQlbfWkUqPgyd'
];

console.log('Testing Google Drive URL conversion...\n');

for (const url of testUrls) {
const converted = convertGoogleDriveUrl(url);
console.log(`Original: ${url}`);
console.log(`Converted: ${converted}`);

try {
const response = await fetch(converted, { method: 'HEAD' });
console.log(`Status: ${response.status}`);
console.log(`Content-Type: ${response.headers.get('content-type')}`);
console.log(`Content-Length: ${response.headers.get('content-length')}`);
} catch (error) {
console.log(`Error: ${error.message}`);
}
console.log('---\n');
}
Loading