shahariaazam/gdrive-direct-download-link
Composer 安装命令:
composer require shahariaazam/gdrive-direct-download-link
包简介
Extract downloadable link from any Google Drive sharable link. Easy to use to embed or use direct Google Drive download link
README 文档
README
Get direct download link from any Google Drive sharable link. So you don't need to open Google Drive webpage to download the file.
Also it can help you to embed assets anywhere because the link you will extract from this library will directly download the assets without going to any middle-page.
Installation
It's very easy to use with composer. Run the following command -
composer require shahariaazam/gdrive-direct-download-link
It will add the package shahariaazam/gdrive-direct-download-link in your project.
Usage
Via Composer
<?php use ShahariaAzam\GDriveLinkExtractor\GoogleDriveLink; require "vendor/autoload.php"; $sharableURL = 'GOOGLE_DRIVE_SHARABLE_LINK'; $downloadLink = GoogleDriveLink::get($sharableURL);
Without Installation
It's a very tiny library. But if you don't want to install it. Here is the function that you can use.
<?php function downloadLink($sharableLink) { return preg_replace("/\/file\/d\/(.+)\/(.+)/", "/uc?export=download&id=$1", $sharableLink); } echo downloadLink('https://drive.google.com/file/d/FAKE_FILE_ID/view?usp=sharing');
Yes, it's that simple.
Note: I just made this as a composer package because I wanted to make it testable for future compatibility
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-30