定制 shahariaazam/gdrive-direct-download-link 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Code Checks Build Code Coverage Code Rating Code Intellegence

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

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固