1 | # simpleYT
|
2 |
|
3 | [![install size](https://packagephobia.com/badge?p=simpleyt%40latest)](https://packagephobia.com/result?p=simpleyt%40latest)
|
4 | [![image](https://img.shields.io/github/license/kimcore/simpleYT)](https://github.com/kimcore/simpleYT/blob/master/LICENSE)
|
5 |
|
6 | [![image](https://nodei.co/npm/simpleyt.png?downloads=true&stars=true)](https://nodei.co/npm/simpleyt/)
|
7 |
|
8 | > Simple youtube search library without need of an api key
|
9 |
|
10 | ## Usage
|
11 | If you intend to use this library on a browser, use jsDelivr:
|
12 | ```html
|
13 | <script src="https://cdn.jsdelivr.net/gh/kimcore/simpleyt@latest/browser/simpleyt.min.js"></script>
|
14 | ```
|
15 | and then you can use `require('simpleyt')` like the example below:
|
16 | ```js
|
17 | const simpleYT = require('simpleyt')
|
18 | const query = 'very long playlist'
|
19 | simpleYT(query, {
|
20 | filter: 'video',
|
21 | // Available filters: video, playlist
|
22 |
|
23 | localAddress: '2001:470:1234:5678::a',
|
24 | family: 6
|
25 | // Other parameters are passed to miniget (https)
|
26 | }).then(console.log)
|
27 | ```
|
28 | ## Result
|
29 | ```js
|
30 | [
|
31 | {
|
32 | type: 'video',
|
33 | identifier: 'nPuHl_Hl2xI',
|
34 | uri: 'https://www.youtube.com/watch?v=nPuHl_Hl2xI',
|
35 | title: '12 HOURS LONG RELAX MUSIC - Relaxation, Meditation, Sleep and Spa Music by RELAX CHANNEL ☯188',
|
36 | author: {
|
37 | name: 'RELAX CHANNEL',
|
38 | profile: 'https://yt3.ggpht.com/a-/AOh14GiqEKfh0k2lWpQVJU18CYULkb9XL2g8i7Jd2A=s68-c-k-c0x00ffffff-no-rj-mo',
|
39 | uri: 'https://www.youtube.com/user/relaxvideoschannel'
|
40 | },
|
41 | length: { ms: 42888000, sec: 42888 },
|
42 | isStream: false,
|
43 | thumbnails: [
|
44 | {
|
45 | url: 'https://i.ytimg.com/vi/nPuHl_Hl2xI/hqdefault.jpg?sqp=-oaymwEjCOADEI4CSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLDtSUSrI3HJLkr-7mEnNfVYjVVLqQ',
|
46 | width: 480,
|
47 | height: 270
|
48 | }
|
49 | ]
|
50 | },
|
51 | ...
|
52 | {
|
53 | type: 'playlist',
|
54 | identifier: 'PLAhZL8hvPmBGp4RpHNHThexBegcjYxcC-',
|
55 | uri: 'https://www.youtube.com/playlist?list=PLAhZL8hvPmBGp4RpHNHThexBegcjYxcC-',
|
56 | title: 'The very long music playlist',
|
57 | author: {
|
58 | name: 'Humphreys Samuel',
|
59 | uri: 'https://www.youtube.com/channel/UC0fAfWQXyTVN-R7NP0BWwGA'
|
60 | },
|
61 | count: 1000,
|
62 | thumbnails: [
|
63 | {
|
64 | url: 'https://i.ytimg.com/vi/WhmlNt42pjk/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCG_urfC1u0JDVyJYBQd3tJ7Tb0kQ',
|
65 | width: 168,
|
66 | height: 94
|
67 | },
|
68 | {
|
69 | url: 'https://i.ytimg.com/vi/0aG4E5jJKtQ/default.jpg',
|
70 | width: 43,
|
71 | height: 20
|
72 | }
|
73 | ]
|
74 | },
|
75 | ...
|
76 | ]
|
77 | ```
|
78 |
|
79 |
|