This project is a web page built using Flutter that allows users to generate direct download links from Google Drive. The project is designed to be easily extendable to support additional cloud storage providers.
- Generate direct download links from Google Drive
- Easily extendable to support other cloud storage providers
- User-friendly web interface
- Built with Flutter for cross-platform compatibility
- Flutter SDK: Installation Guide
-
Clone the repository:
git clone https://github.com/brunodavi/direct_link_generator.git cd direct_link_generator -
Install dependencies:
flutter pub get
-
Run the project:
flutter run -d chrome
- Open the web page in your browser.
- Paste the Google Drive file link in the input field.
- Click the "Generate" button.
- The direct download link will be displayed and can be copied to the clipboard.
To add support for additional cloud storage providers, follow these steps:
-
Create a new Dart file for the provider in the
lib/providersdirectory, similar togoogle_drive_provider.dart. -
Implement the logic to generate direct download links for the provider.
Example:
import 'interfaces/provider_base.dart'; class GoogleDriveProvider implements ProviderBase { @override String? generate(String link) { final regex = RegExp('^https://drive.google.com/file/d/(.+)/.+'); final match = regex.firstMatch(link); if (match == null) return null; final id = match[1]; final directLink = 'https://drive.usercontent.google.com/download?id=$id'; return directLink; } }
-
Add the new provider to the provider list in
generate_link.dart:import '/providers/interfaces/provider_base.dart'; import '/providers/google_drive_provider.dart'; final providers = <ProviderBase>[ GoogleDriveProvider(), ]; String? generateLink(String link) { for (var provider in providers) { final linkGenerated = provider.generate(link); if (linkGenerated != null) return linkGenerated; } return null; }
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or new features to add.
-
core/: Contains the core functionality of the application.generate_link.dart: Core logic to generate direct links.
-
pages/: Contains the UI components and pages.components/: Contains reusable UI components.app_bar.dart: Custom app bar component.
home_page.dart: The main home page of the application.
-
providers/: Contains the provider implementations and interfaces.interfaces/: Contains the base interface for providers.provider_base.dart: Base interface for providers.
google_drive_provider.dart: Implementation for Google Drive provider.
-
services/: Contains the service layer for additional functionality.interfaces/: Contains interfaces for services.browser_service_base.dart: Base interface for browser services.clipboard_service_base.dart: Base interface for clipboard services.
browser_service.dart: Implementation for browser service.clipboard_service.dart: Implementation for clipboard service.
-
main.dart: Entry point of the application.
This project is licensed under the MIT License. See the LICENSE file for more details.