GithubHelp home page GithubHelp logo

thanhtoan1196 / streaming-link-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aalfiann/streaming-link-generator

0.0 0.0 0.0 7 KB

Grab video streaming link from Google Drive.

PHP 100.00%

streaming-link-generator's Introduction

Streaming Link Generator

Grab video streaming link (for Video.js, jwplayer etc) from Google Drive.

<?php

include_once dirname(__FILE__) . '/../vendor/autoload.php';

use SergeyHartmann\StreamingLinkGenerator\Generator;
use SergeyHartmann\StreamingLinkGenerator\StreamingLink;
use SergeyHartmann\StreamingLinkGenerator\CookieLoader\SimpleCookieLoader;

$cookieLoader = new SimpleCookieLoader(dirname(__FILE__) . '/g.cookie');
$generator    = new Generator($cookieLoader);

/** @var StreamingLink $streamingLink */
$streamingLink = $generator->generate('<YOUR_GOOGLE_DRIVE_FILE_ID>');

echo 'Filename: '        . $streamingLink->getName()          . PHP_EOL 
    . 'Streaming link: ' . $streamingLink->getStreamingLink() . PHP_EOL 
    . 'Download link: '  . $streamingLink->getDownloadLink()  . PHP_EOL 
    . 'Content type: '   . $streamingLink->getContentType()   . PHP_EOL
;
Filename: SampleVideo_1280x720_10mb.mp4
Streaming link: https://doc-0c-24-docs.googleusercontent.com/docs/securesc/ha0ro937...
Download link: https://doc-0c-24-docs.googleusercontent.com/docs/securesc/ha0ro937...?e=download
Content type: video/mp4

Installation

The recommended way to install StreamingLinkGenerator is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of StreamingLinkGenerator:

php composer.phar require sergeyhartmann/streaming-link-generator

See example/index.php for getting started.

How to Find Google Drive File ID

  1. Share that video.
  2. Get shareable link https://drive.google.com/open?id=<FILE_ID>.

streaming-link-generator's People

Contributors

sergeyhartmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.