Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yoannchb-pro/drive-album
Tranform your google drive into an album api for your website
https://github.com/yoannchb-pro/drive-album
album api drive free google google-drive image scraper
Last synced: about 1 month ago
JSON representation
Tranform your google drive into an album api for your website
- Host: GitHub
- URL: https://github.com/yoannchb-pro/drive-album
- Owner: yoannchb-pro
- License: mit
- Created: 2022-02-22T22:49:18.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-23T16:18:33.000Z (almost 3 years ago)
- Last Synced: 2024-10-24T22:11:13.737Z (3 months ago)
- Topics: album, api, drive, free, google, google-drive, image, scraper
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Drive-album v1.0.1
Transform a google drive folder into an api to stock your images and albums
## Update
- Fixed image url
## Installation ?
```
npm i drive-album
```## How to use ?
- Dont forget to set the folder in public mode
```js
const GetGoogleDrive = require('drive-album');const drive = await GetGoogleDrive("https://drive.google.com/drive/folders/1UJ4PiRfyhPelXacznccRoGBPXLDEDvCb?usp=sharing");
const drive = await GetGoogleDrive("1UJ4PiRfyhPelXacznccRoGBPXLDEDvCb");//if you want to explore all the subtree folders
await GetGoogleDrive(..., true);
```## Result
- Subtree exploring
```json
[
{
"id": "1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
"name": "ALBUM1",
"realType": "application/vnd.google-apps.folder",
"type": "folder",
"url": "https://drive.google.com/drive/folders/1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
"content": [
{
"id": "19mppIinV6H-5yEJrpI_IEV6kOaqcYXYV",
"name": "testimage.png",
"realType": "image/png",
"type": "image",
"url": "https://lh3.google.com/u/0/d/19mppIinV6H-5yEJrpI_IEV6kOaqcYXYV=w1920-h942-iv2"
}
]
},
{
"id": "1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
"name": "ALBUM2",
"realType": "application/vnd.google-apps.folder",
"type": "folder",
"url": "https://drive.google.com/drive/folders/1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
"content": []
},
{
"id": "18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA",
"name": "testimage1.png",
"realType": "image/png",
"type": "image",
"url": "https://lh3.google.com/u/0/d/18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA=w1920-h942-iv2"
}
]
```- No subtree exploring (You can see the content of a folder with GetGoogleDrive("Folder id"))
```json
[
{
"id": "1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
"name": "ALBUM1",
"realType": "application/vnd.google-apps.folder",
"type": "folder",
"url": "https://drive.google.com/drive/folders/1e82I6XdsT6Sla4JI6Eg-cfqQFx8PoZbv",
},
{
"id": "1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
"name": "ALBUM2",
"realType": "application/vnd.google-apps.folder",
"type": "folder",
"url": "https://drive.google.com/drive/folders/1j1bM93BzEUFq9qnxkg83zCU7EagFmdpI",
},
{
"id": "18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA",
"name": "testimage1.png",
"realType": "image/png",
"type": "image",
"url": "https://lh3.google.com/u/0/d/18wLall8RXQpEbUn_tOsO_IAXbyCoVaLA=w1920-h942-iv2"
}
]
```## Example
```js
const GetGoogleDrive = require('drive-album');
const fs = require('fs');async function test(){
const drive = await GetGoogleDrive("1UJ4PiRfyhPelXacznccRoGBPXLDEDvCb", true);
fs.writeFileSync("test.json", JSON.stringify(drive, undefined, 4));
}test();
```