youtubei 0.0.1-rc.7 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +50 -53
  3. package/dist/cjs/classes/Base/Base.js +10 -0
  4. package/dist/{index.js → cjs/classes/Base/index.js} +13 -13
  5. package/dist/cjs/classes/BaseChannel/BaseChannel.js +31 -0
  6. package/dist/cjs/classes/BaseChannel/BaseChannelParser.js +24 -0
  7. package/dist/cjs/classes/BaseChannel/ChannelPlaylists.js +57 -0
  8. package/dist/cjs/classes/BaseChannel/ChannelVideos.js +57 -0
  9. package/dist/{classes/client → cjs/classes/BaseChannel}/index.js +16 -19
  10. package/dist/cjs/classes/BaseVideo/BaseVideo.js +34 -0
  11. package/dist/cjs/classes/BaseVideo/BaseVideoParser.js +82 -0
  12. package/dist/cjs/classes/BaseVideo/VideoRelated.js +39 -0
  13. package/dist/{common → cjs/classes/BaseVideo}/index.js +15 -21
  14. package/dist/cjs/classes/Channel/Channel.js +24 -0
  15. package/dist/cjs/classes/Channel/ChannelParser.js +55 -0
  16. package/dist/cjs/classes/Channel/index.js +13 -0
  17. package/dist/cjs/classes/Chat/Chat.js +23 -0
  18. package/dist/cjs/classes/Chat/ChatParser.js +21 -0
  19. package/dist/cjs/classes/Chat/index.js +13 -0
  20. package/dist/cjs/classes/Client/Client.js +101 -0
  21. package/dist/cjs/classes/Client/HTTP.js +59 -0
  22. package/dist/cjs/classes/Client/index.js +13 -0
  23. package/dist/cjs/classes/Comment/Comment.js +29 -0
  24. package/dist/cjs/classes/Comment/CommentParser.js +43 -0
  25. package/dist/cjs/classes/Comment/CommentReplies.js +36 -0
  26. package/dist/cjs/classes/Comment/index.js +13 -0
  27. package/dist/cjs/classes/Continuable/Continuable.js +43 -0
  28. package/dist/cjs/classes/Continuable/index.js +13 -0
  29. package/dist/cjs/classes/LiveVideo/LiveVideo.js +84 -0
  30. package/dist/cjs/classes/LiveVideo/LiveVideoParser.js +29 -0
  31. package/dist/cjs/classes/LiveVideo/index.js +14 -0
  32. package/dist/cjs/classes/MixPlaylist/MixPlaylist.js +25 -0
  33. package/dist/cjs/classes/MixPlaylist/MixPlaylistParser.js +27 -0
  34. package/dist/cjs/classes/MixPlaylist/index.js +14 -0
  35. package/dist/cjs/classes/Playlist/Playlist.js +25 -0
  36. package/dist/cjs/classes/Playlist/PlaylistParser.js +83 -0
  37. package/dist/cjs/classes/Playlist/PlaylistVideos.js +50 -0
  38. package/dist/cjs/classes/Playlist/index.js +15 -0
  39. package/dist/cjs/classes/PlaylistCompact/PlaylistCompact.js +45 -0
  40. package/dist/cjs/classes/PlaylistCompact/PlaylistCompactParser.js +28 -0
  41. package/dist/cjs/classes/PlaylistCompact/index.js +14 -0
  42. package/dist/cjs/classes/Reply/Reply.js +23 -0
  43. package/dist/cjs/classes/Reply/ReplyParser.js +26 -0
  44. package/dist/cjs/classes/Reply/index.js +14 -0
  45. package/dist/cjs/classes/SearchManager/SearchManager.js +83 -0
  46. package/dist/cjs/classes/SearchManager/SearchManagerParser.js +40 -0
  47. package/dist/cjs/classes/SearchManager/index.js +14 -0
  48. package/dist/{common/types.js → cjs/classes/SearchManager/proto/SearchProto.js} +2 -2
  49. package/dist/cjs/classes/SearchManager/proto/index.js +57 -0
  50. package/dist/cjs/classes/Thumbnails/Thumbnails.js +67 -0
  51. package/dist/cjs/classes/Thumbnails/index.js +13 -0
  52. package/dist/cjs/classes/Video/Video.js +26 -0
  53. package/dist/cjs/classes/Video/VideoComments.js +53 -0
  54. package/dist/cjs/classes/Video/VideoParser.js +29 -0
  55. package/dist/cjs/classes/Video/index.js +14 -0
  56. package/dist/cjs/classes/VideoCompact/VideoCompact.js +49 -0
  57. package/dist/cjs/classes/VideoCompact/VideoCompactParser.js +36 -0
  58. package/dist/cjs/classes/VideoCompact/index.js +14 -0
  59. package/dist/cjs/classes/index.js +29 -0
  60. package/dist/{src → cjs}/common/decorators.js +14 -15
  61. package/dist/cjs/common/helper.js +45 -0
  62. package/dist/{src → cjs}/common/index.js +16 -21
  63. package/dist/cjs/common/mixins.js +14 -0
  64. package/dist/{classes/client → cjs/common}/types.js +2 -2
  65. package/dist/{src → cjs}/constants.js +10 -9
  66. package/dist/{src → cjs}/index.js +13 -13
  67. package/dist/esm/classes/Base/Base.js +8 -0
  68. package/dist/esm/classes/Base/index.js +1 -0
  69. package/dist/esm/classes/BaseChannel/BaseChannel.js +48 -0
  70. package/dist/esm/classes/BaseChannel/BaseChannelParser.js +24 -0
  71. package/dist/esm/classes/BaseChannel/ChannelPlaylists.js +109 -0
  72. package/dist/esm/classes/BaseChannel/ChannelVideos.js +109 -0
  73. package/dist/esm/classes/BaseChannel/index.js +4 -0
  74. package/dist/esm/classes/BaseVideo/BaseVideo.js +51 -0
  75. package/dist/esm/classes/BaseVideo/BaseVideoParser.js +93 -0
  76. package/dist/esm/classes/BaseVideo/VideoRelated.js +87 -0
  77. package/dist/esm/classes/BaseVideo/index.js +3 -0
  78. package/dist/esm/classes/Channel/Channel.js +37 -0
  79. package/dist/esm/classes/Channel/ChannelParser.js +77 -0
  80. package/dist/esm/classes/Channel/index.js +1 -0
  81. package/dist/esm/classes/Chat/Chat.js +36 -0
  82. package/dist/esm/classes/Chat/ChatParser.js +21 -0
  83. package/dist/esm/classes/Chat/index.js +1 -0
  84. package/dist/esm/classes/Client/Client.js +176 -0
  85. package/dist/esm/classes/Client/HTTP.js +112 -0
  86. package/dist/esm/classes/Client/index.js +1 -0
  87. package/dist/esm/classes/Comment/Comment.js +46 -0
  88. package/dist/esm/classes/Comment/CommentParser.js +45 -0
  89. package/dist/esm/classes/Comment/CommentReplies.js +84 -0
  90. package/dist/esm/classes/Comment/index.js +1 -0
  91. package/dist/esm/classes/Continuable/Continuable.js +125 -0
  92. package/dist/esm/classes/Continuable/index.js +1 -0
  93. package/dist/esm/classes/LiveVideo/LiveVideo.js +160 -0
  94. package/dist/esm/classes/LiveVideo/LiveVideoParser.js +29 -0
  95. package/dist/esm/classes/LiveVideo/index.js +2 -0
  96. package/dist/esm/classes/MixPlaylist/MixPlaylist.js +38 -0
  97. package/dist/esm/classes/MixPlaylist/MixPlaylistParser.js +49 -0
  98. package/dist/esm/classes/MixPlaylist/index.js +2 -0
  99. package/dist/esm/classes/Playlist/Playlist.js +38 -0
  100. package/dist/esm/classes/Playlist/PlaylistParser.js +105 -0
  101. package/dist/esm/classes/Playlist/PlaylistVideos.js +98 -0
  102. package/dist/esm/classes/Playlist/index.js +3 -0
  103. package/dist/esm/classes/PlaylistCompact/PlaylistCompact.js +90 -0
  104. package/dist/esm/classes/PlaylistCompact/PlaylistCompactParser.js +28 -0
  105. package/dist/esm/classes/PlaylistCompact/index.js +2 -0
  106. package/dist/esm/classes/Reply/Reply.js +36 -0
  107. package/dist/esm/classes/Reply/ReplyParser.js +26 -0
  108. package/dist/esm/classes/Reply/index.js +2 -0
  109. package/dist/esm/classes/SearchManager/SearchManager.js +159 -0
  110. package/dist/esm/classes/SearchManager/SearchManagerParser.js +62 -0
  111. package/dist/esm/classes/SearchManager/index.js +2 -0
  112. package/dist/esm/classes/SearchManager/proto/SearchProto.js +1 -0
  113. package/dist/esm/classes/SearchManager/proto/index.js +39 -0
  114. package/dist/esm/classes/Thumbnails/Thumbnails.js +109 -0
  115. package/dist/esm/classes/Thumbnails/index.js +1 -0
  116. package/dist/esm/classes/Video/Video.js +39 -0
  117. package/dist/esm/classes/Video/VideoComments.js +101 -0
  118. package/dist/esm/classes/Video/VideoParser.js +31 -0
  119. package/dist/esm/classes/Video/index.js +2 -0
  120. package/dist/esm/classes/VideoCompact/VideoCompact.js +98 -0
  121. package/dist/esm/classes/VideoCompact/VideoCompactParser.js +36 -0
  122. package/dist/esm/classes/VideoCompact/index.js +2 -0
  123. package/dist/esm/classes/index.js +17 -0
  124. package/dist/esm/common/decorators.js +30 -0
  125. package/dist/esm/common/helper.js +61 -0
  126. package/dist/{common/index.d.ts → esm/common/index.js} +4 -4
  127. package/dist/esm/common/mixins.js +10 -0
  128. package/dist/esm/common/types.js +1 -0
  129. package/dist/esm/constants.js +7 -0
  130. package/dist/{index.d.ts → esm/index.js} +1 -1
  131. package/dist/typings/classes/Base/Base.d.ts +11 -0
  132. package/dist/typings/classes/Base/index.d.ts +1 -0
  133. package/dist/typings/classes/BaseChannel/BaseChannel.d.ts +43 -0
  134. package/dist/typings/classes/BaseChannel/BaseChannelParser.d.ts +7 -0
  135. package/dist/typings/classes/BaseChannel/ChannelPlaylists.d.ts +30 -0
  136. package/dist/typings/classes/BaseChannel/ChannelVideos.d.ts +30 -0
  137. package/dist/typings/classes/BaseChannel/index.d.ts +4 -0
  138. package/dist/typings/classes/BaseVideo/BaseVideo.d.ts +59 -0
  139. package/dist/typings/classes/BaseVideo/BaseVideoParser.d.ts +14 -0
  140. package/dist/typings/classes/BaseVideo/VideoRelated.d.ts +21 -0
  141. package/dist/typings/classes/BaseVideo/index.d.ts +3 -0
  142. package/dist/typings/classes/Channel/Channel.d.ts +33 -0
  143. package/dist/typings/classes/Channel/ChannelParser.d.ts +6 -0
  144. package/dist/typings/classes/Channel/index.d.ts +1 -0
  145. package/dist/typings/classes/Chat/Chat.d.ts +33 -0
  146. package/dist/typings/classes/Chat/ChatParser.d.ts +5 -0
  147. package/dist/typings/classes/Chat/index.d.ts +1 -0
  148. package/dist/typings/classes/Client/Client.d.ts +41 -0
  149. package/dist/typings/classes/Client/HTTP.d.ts +21 -0
  150. package/dist/typings/classes/Client/index.d.ts +1 -0
  151. package/dist/typings/classes/Comment/Comment.d.ts +51 -0
  152. package/dist/typings/classes/Comment/CommentParser.d.ts +8 -0
  153. package/dist/typings/classes/Comment/CommentReplies.d.ts +17 -0
  154. package/dist/typings/classes/Comment/index.d.ts +1 -0
  155. package/dist/typings/classes/Continuable/Continuable.d.ts +24 -0
  156. package/dist/typings/classes/Continuable/index.d.ts +1 -0
  157. package/dist/typings/classes/LiveVideo/LiveVideo.d.ts +46 -0
  158. package/dist/typings/classes/LiveVideo/LiveVideoParser.d.ts +10 -0
  159. package/dist/typings/classes/LiveVideo/index.d.ts +2 -0
  160. package/dist/typings/classes/MixPlaylist/MixPlaylist.d.ts +29 -0
  161. package/dist/typings/classes/MixPlaylist/MixPlaylistParser.d.ts +6 -0
  162. package/dist/typings/classes/MixPlaylist/index.d.ts +2 -0
  163. package/dist/typings/classes/Playlist/Playlist.d.ts +39 -0
  164. package/dist/typings/classes/Playlist/PlaylistParser.d.ts +16 -0
  165. package/dist/typings/classes/Playlist/PlaylistVideos.d.ts +31 -0
  166. package/dist/typings/classes/Playlist/index.d.ts +3 -0
  167. package/dist/typings/classes/PlaylistCompact/PlaylistCompact.d.ts +43 -0
  168. package/dist/typings/classes/PlaylistCompact/PlaylistCompactParser.d.ts +5 -0
  169. package/dist/typings/classes/PlaylistCompact/index.d.ts +2 -0
  170. package/dist/typings/classes/Reply/Reply.d.ts +43 -0
  171. package/dist/typings/classes/Reply/ReplyParser.d.ts +5 -0
  172. package/dist/typings/classes/Reply/index.d.ts +2 -0
  173. package/dist/typings/classes/SearchManager/SearchManager.d.ts +51 -0
  174. package/dist/typings/classes/SearchManager/SearchManagerParser.d.ts +13 -0
  175. package/dist/typings/classes/SearchManager/index.d.ts +2 -0
  176. package/dist/typings/classes/SearchManager/proto/SearchProto.d.ts +13 -0
  177. package/dist/typings/classes/SearchManager/proto/index.d.ts +24 -0
  178. package/dist/typings/classes/Thumbnails/Thumbnails.d.ts +41 -0
  179. package/dist/typings/classes/Thumbnails/index.d.ts +1 -0
  180. package/dist/typings/classes/Video/Video.d.ts +24 -0
  181. package/dist/typings/classes/Video/VideoComments.d.ts +34 -0
  182. package/dist/typings/classes/Video/VideoParser.d.ts +8 -0
  183. package/dist/typings/classes/Video/index.d.ts +2 -0
  184. package/dist/typings/classes/VideoCompact/VideoCompact.d.ts +57 -0
  185. package/dist/typings/classes/VideoCompact/VideoCompactParser.d.ts +5 -0
  186. package/dist/typings/classes/VideoCompact/index.d.ts +2 -0
  187. package/dist/typings/classes/index.d.ts +17 -0
  188. package/dist/{src → typings}/common/decorators.d.ts +5 -7
  189. package/dist/typings/common/helper.d.ts +5 -0
  190. package/dist/{src → typings}/common/index.d.ts +4 -4
  191. package/dist/typings/common/mixins.d.ts +1 -0
  192. package/dist/{common → typings/common}/types.d.ts +1 -2
  193. package/dist/{constants.d.ts → typings/constants.d.ts} +7 -6
  194. package/dist/{src → typings}/index.d.ts +1 -1
  195. package/package.json +68 -53
  196. package/CHANGELOG.md +0 -6
  197. package/dist/classes/Base.d.ts +0 -8
  198. package/dist/classes/Base.js +0 -10
  199. package/dist/classes/Channel.d.ts +0 -63
  200. package/dist/classes/Channel.js +0 -115
  201. package/dist/classes/Comment.d.ts +0 -51
  202. package/dist/classes/Comment.js +0 -47
  203. package/dist/classes/LiveVideo.d.ts +0 -3
  204. package/dist/classes/LiveVideo.js +0 -12
  205. package/dist/classes/Playlist.d.ts +0 -66
  206. package/dist/classes/Playlist.js +0 -133
  207. package/dist/classes/PlaylistCompact.d.ts +0 -35
  208. package/dist/classes/PlaylistCompact.js +0 -47
  209. package/dist/classes/SearchResult.d.ts +0 -52
  210. package/dist/classes/SearchResult.js +0 -121
  211. package/dist/classes/Test.d.ts +0 -7
  212. package/dist/classes/Test.js +0 -9
  213. package/dist/classes/Thumbnails.d.ts +0 -23
  214. package/dist/classes/Thumbnails.js +0 -42
  215. package/dist/classes/Video.d.ts +0 -90
  216. package/dist/classes/Video.js +0 -153
  217. package/dist/classes/VideoCompact.d.ts +0 -46
  218. package/dist/classes/VideoCompact.js +0 -53
  219. package/dist/classes/client/Client.d.ts +0 -26
  220. package/dist/classes/client/Client.js +0 -63
  221. package/dist/classes/client/index.d.ts +0 -2
  222. package/dist/classes/client/types.d.ts +0 -12
  223. package/dist/classes/client.d.ts +0 -17
  224. package/dist/classes/client.js +0 -57
  225. package/dist/classes/index.d.ts +0 -10
  226. package/dist/classes/index.js +0 -26
  227. package/dist/common/decorators.d.ts +0 -7
  228. package/dist/common/decorators.js +0 -15
  229. package/dist/common/helper.d.ts +0 -4
  230. package/dist/common/helper.js +0 -39
  231. package/dist/common/http.d.ts +0 -33
  232. package/dist/common/http.js +0 -105
  233. package/dist/constants.js +0 -9
  234. package/dist/src/classes/Base.d.ts +0 -8
  235. package/dist/src/classes/Base.js +0 -10
  236. package/dist/src/classes/Channel.d.ts +0 -37
  237. package/dist/src/classes/Channel.js +0 -82
  238. package/dist/src/classes/Client.d.ts +0 -14
  239. package/dist/src/classes/Client.js +0 -51
  240. package/dist/src/classes/Comment.d.ts +0 -51
  241. package/dist/src/classes/Comment.js +0 -47
  242. package/dist/src/classes/Playlist.d.ts +0 -66
  243. package/dist/src/classes/Playlist.js +0 -133
  244. package/dist/src/classes/PlaylistCompact.d.ts +0 -35
  245. package/dist/src/classes/PlaylistCompact.js +0 -47
  246. package/dist/src/classes/SearchResult.d.ts +0 -53
  247. package/dist/src/classes/SearchResult.js +0 -122
  248. package/dist/src/classes/Thumbnails.d.ts +0 -24
  249. package/dist/src/classes/Thumbnails.js +0 -42
  250. package/dist/src/classes/Video.d.ts +0 -90
  251. package/dist/src/classes/Video.js +0 -153
  252. package/dist/src/classes/VideoCompact.d.ts +0 -46
  253. package/dist/src/classes/VideoCompact.js +0 -53
  254. package/dist/src/classes/index.d.ts +0 -10
  255. package/dist/src/classes/index.js +0 -26
  256. package/dist/src/common/helper.d.ts +0 -4
  257. package/dist/src/common/helper.js +0 -39
  258. package/dist/src/common/http.d.ts +0 -33
  259. package/dist/src/common/http.js +0 -105
  260. package/dist/src/common/types.d.ts +0 -2
  261. package/dist/src/common/types.js +0 -2
  262. package/dist/src/constants.d.ts +0 -6
  263. package/dist/tempCodeRunnerFile.d.ts +0 -8
  264. package/dist/tempCodeRunnerFile.js +0 -15
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Vincent Jonathan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Vincent Jonathan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,53 +1,50 @@
1
- # Youtubei (WIP)
2
-
3
- `Youtubei` is made to replace my other library [scrape-yt](https://github.com/SuspiciousLookingOwl/scrape-yt/). Instead of scrapping data from Youtube page, `youtubei` fetches data by sending a request directly to `https://www.youtube.com/youtubei/v1`, which should be faster and provide more reliable result.
4
-
5
- <b>Requires Node >= 12</b>
6
-
7
- #### [Documentation](https://youtubei.netlify.app/)
8
-
9
- ## Installation
10
- ```
11
- npm i youtubei
12
- ```
13
-
14
-
15
- ## Example
16
- ```js
17
- const { Client } = require("youtubei");
18
- // or for TS / ES6
19
- import { Client } from "youtubei";
20
-
21
- const youtube = new Client();
22
-
23
- const run = async () => {
24
- const videos = await youtube.search("Never gonna give you up", {
25
- type: "video", // video | playlist | channel | all
26
- });
27
-
28
- console.log(videos.length); // 20
29
- const nextVideos = await videos.next(); // load next page
30
- console.log(nextVideos.length); // 18-20, inconsistent next videos count from youtube
31
- console.log(videos.length); // 38 - 40
32
-
33
- // you can also pass the video URL
34
- const video = await youtube.getVideo("dQw4w9WgXcQ");
35
-
36
- const channelVideos = await video.channel.getVideos();
37
- const channelPlaylists = await video.channel.getPlaylists();
38
-
39
- // you can also pass the playlist URL
40
- const playlist = await youtube.getPlaylist("UUHnyfMqiRRG1u-2MsSQLbXA");
41
- console.log(playlist.videos.length); // first 100 videos;
42
- let newVideos = await playlist.next(); // load next 100 videos
43
- console.log(playlist.videos.length); // 200 videos;
44
- await playlist.next(0); // load the rest videos in the playlist
45
-
46
- };
47
-
48
- run();
49
- ```
50
-
51
- ## Features to be added
52
- - [ ] Live chat event listener
53
- - [ ] Get Comment replies
1
+ # Youtubei
2
+
3
+ `Youtubei` is made to replace my other library [scrape-yt](https://github.com/SuspiciousLookingOwl/scrape-yt/). Instead of scrapping data from Youtube page, `youtubei` fetches data by sending a request directly to `https://www.youtube.com/youtubei/v1`, which should be faster and provide more reliable result.
4
+
5
+ <b>Requires Node >= 12</b>
6
+
7
+ #### [Documentation](https://suspiciouslookingowl.github.io/youtubei)
8
+
9
+ ## Installation
10
+
11
+ ```
12
+ npm i youtubei
13
+ ```
14
+
15
+ ## Example
16
+
17
+ ```js
18
+ const { Client } = require("youtubei");
19
+ // or for TS / ES6
20
+ import { Client } from "youtubei";
21
+
22
+ const youtube = new Client();
23
+
24
+ const run = async () => {
25
+ const videos = await youtube.search("Never gonna give you up", {
26
+ type: "video", // video | playlist | channel | all
27
+ });
28
+
29
+ console.log(videos.items.length); // 20
30
+ const nextVideos = await videos.next(); // load next page
31
+ console.log(nextVideos.length); // 18-20, inconsistent next videos count from youtube
32
+ console.log(videos.items.length); // 38 - 40
33
+
34
+ // you can also pass the video URL
35
+ const video = await youtube.getVideo("dQw4w9WgXcQ");
36
+
37
+ const channelVideos = await video.channel.videos.next();
38
+ const channelPlaylists = await video.channel.playlists.next();
39
+
40
+ // you can also pass the playlist URL
41
+ const playlist = await youtube.getPlaylist("UUHnyfMqiRRG1u-2MsSQLbXA");
42
+ console.log(playlist.videos.items.length); // first 100 videos;
43
+ let newVideos = await playlist.videos.next(); // load next 100 videos
44
+ console.log(playlist.videos.items.length); // 200 videos;
45
+ await playlist.videos.next(0); // load the rest videos in the playlist
46
+
47
+ };
48
+
49
+ run();
50
+ ```
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Base = void 0;
4
+ class Base {
5
+ /** @hidden */
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ }
10
+ exports.Base = Base;
@@ -1,13 +1,13 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./classes"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./Base"), exports);
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseChannel = void 0;
4
+ const Base_1 = require("../Base");
5
+ const BaseChannelParser_1 = require("./BaseChannelParser");
6
+ const ChannelPlaylists_1 = require("./ChannelPlaylists");
7
+ const ChannelVideos_1 = require("./ChannelVideos");
8
+ /** Represents a Youtube Channel */
9
+ class BaseChannel extends Base_1.Base {
10
+ /** @hidden */
11
+ constructor(attr) {
12
+ super(attr.client);
13
+ Object.assign(this, attr);
14
+ this.videos = new ChannelVideos_1.ChannelVideos({ channel: this, client: this.client });
15
+ this.playlists = new ChannelPlaylists_1.ChannelPlaylists({ channel: this, client: this.client });
16
+ }
17
+ /** The URL of the channel page */
18
+ get url() {
19
+ return `https://www.youtube.com/channel/${this.id}`;
20
+ }
21
+ /**
22
+ * Load this instance with raw data from Youtube
23
+ *
24
+ * @hidden
25
+ */
26
+ load(data) {
27
+ BaseChannelParser_1.BaseChannelParser.loadBaseChannel(this, data);
28
+ return this;
29
+ }
30
+ }
31
+ exports.BaseChannel = BaseChannel;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseChannelParser = void 0;
4
+ const common_1 = require("../../common");
5
+ const Thumbnails_1 = require("../Thumbnails");
6
+ class BaseChannelParser {
7
+ static loadBaseChannel(target, data) {
8
+ const { channelId, title, thumbnail, videoCountText, subscriberCountText } = data;
9
+ target.id = channelId;
10
+ target.name = title.simpleText;
11
+ target.thumbnails = new Thumbnails_1.Thumbnails().load(thumbnail.thumbnails);
12
+ target.videoCount = common_1.stripToInt(videoCountText === null || videoCountText === void 0 ? void 0 : videoCountText.runs[0].text) || 0;
13
+ target.subscriberCount = subscriberCountText === null || subscriberCountText === void 0 ? void 0 : subscriberCountText.simpleText;
14
+ return target;
15
+ }
16
+ /** Parse tab data from request, tab name is ignored if it's a continuation data */
17
+ static parseTabData(name, data) {
18
+ var _a;
19
+ const index = name === "videos" ? 1 : 2;
20
+ return (((_a = data.contents) === null || _a === void 0 ? void 0 : _a.twoColumnBrowseResultsRenderer.tabs[index].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer.items) ||
21
+ data.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems);
22
+ }
23
+ }
24
+ exports.BaseChannelParser = BaseChannelParser;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ChannelPlaylists = void 0;
13
+ const common_1 = require("../../common");
14
+ const constants_1 = require("../../constants");
15
+ const Continuable_1 = require("../Continuable");
16
+ const PlaylistCompact_1 = require("../PlaylistCompact");
17
+ const BaseChannelParser_1 = require("./BaseChannelParser");
18
+ /**
19
+ * {@link Continuable} of playlists inside a {@link BaseChannel}
20
+ *
21
+ * @example
22
+ * ```js
23
+ * const channel = await youtube.findOne(CHANNEL_NAME, {type: "channel"});
24
+ * await channel.playlists.next();
25
+ * console.log(channel.playlists.items) // first 30 playlists
26
+ *
27
+ * let newPlaylists = await channel.playlists.next();
28
+ * console.log(newPlaylists) // 30 loaded playlists
29
+ * console.log(channel.playlists.items) // first 60 playlists
30
+ *
31
+ * await channel.playlists.next(0); // load the rest of the playlists in the channel
32
+ * ```
33
+ */
34
+ class ChannelPlaylists extends Continuable_1.Continuable {
35
+ /** @hidden */
36
+ constructor({ client, channel }) {
37
+ super({ client, strictContinuationCheck: true });
38
+ this.channel = channel;
39
+ }
40
+ fetch() {
41
+ var _a;
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const params = "EglwbGF5bGlzdHMgAQ%3D%3D";
44
+ const response = yield this.client.http.post(`${constants_1.I_END_POINT}/browse`, {
45
+ data: { browseId: (_a = this.channel) === null || _a === void 0 ? void 0 : _a.id, params, continuation: this.continuation },
46
+ });
47
+ const items = BaseChannelParser_1.BaseChannelParser.parseTabData("playlists", response.data);
48
+ const continuation = common_1.getContinuationFromItems(items);
49
+ const data = common_1.mapFilter(items, "gridPlaylistRenderer");
50
+ return {
51
+ continuation,
52
+ items: data.map((i) => new PlaylistCompact_1.PlaylistCompact({ client: this.client }).load(i)),
53
+ };
54
+ });
55
+ }
56
+ }
57
+ exports.ChannelPlaylists = ChannelPlaylists;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ChannelVideos = void 0;
13
+ const common_1 = require("../../common");
14
+ const constants_1 = require("../../constants");
15
+ const Continuable_1 = require("../Continuable");
16
+ const VideoCompact_1 = require("../VideoCompact");
17
+ const BaseChannelParser_1 = require("./BaseChannelParser");
18
+ /**
19
+ * {@link Continuable} of videos inside a {@link BaseChannel}
20
+ *
21
+ * @example
22
+ * ```js
23
+ * const channel = await youtube.findOne(CHANNEL_NAME, {type: "channel"});
24
+ * await channel.videos.next();
25
+ * console.log(channel.videos.items) // first 30 videos
26
+ *
27
+ * let newVideos = await channel.videos.next();
28
+ * console.log(newVideos) // 30 loaded videos
29
+ * console.log(channel.videos.items) // first 60 videos
30
+ *
31
+ * await channel.videos.next(0); // load the rest of the videos in the channel
32
+ * ```
33
+ */
34
+ class ChannelVideos extends Continuable_1.Continuable {
35
+ /** @hidden */
36
+ constructor({ client, channel }) {
37
+ super({ client, strictContinuationCheck: true });
38
+ this.channel = channel;
39
+ }
40
+ fetch() {
41
+ var _a;
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const params = "EgZ2aWRlb3M%3D";
44
+ const response = yield this.client.http.post(`${constants_1.I_END_POINT}/browse`, {
45
+ data: { browseId: (_a = this.channel) === null || _a === void 0 ? void 0 : _a.id, params, continuation: this.continuation },
46
+ });
47
+ const items = BaseChannelParser_1.BaseChannelParser.parseTabData("videos", response.data);
48
+ const continuation = common_1.getContinuationFromItems(items);
49
+ const data = common_1.mapFilter(items, "gridVideoRenderer");
50
+ return {
51
+ continuation,
52
+ items: data.map((i) => new VideoCompact_1.VideoCompact({ client: this.client }).load(i)),
53
+ };
54
+ });
55
+ }
56
+ }
57
+ exports.ChannelVideos = ChannelVideos;
@@ -1,19 +1,16 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Client = void 0;
17
- var Client_1 = require("./Client");
18
- Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return __importDefault(Client_1).default; } });
19
- __exportStar(require("./types"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./BaseChannel"), exports);
14
+ __exportStar(require("./BaseChannelParser"), exports);
15
+ __exportStar(require("./ChannelPlaylists"), exports);
16
+ __exportStar(require("./ChannelVideos"), exports);
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseVideo = void 0;
4
+ const Base_1 = require("../Base");
5
+ const BaseVideoParser_1 = require("./BaseVideoParser");
6
+ const VideoRelated_1 = require("./VideoRelated");
7
+ /** Represents a Video */
8
+ class BaseVideo extends Base_1.Base {
9
+ /** @hidden */
10
+ constructor(attr) {
11
+ super(attr.client);
12
+ Object.assign(this, attr);
13
+ this.related = new VideoRelated_1.VideoRelated({ client: this.client, video: this });
14
+ }
15
+ /**
16
+ * Load this instance with raw data from Youtube
17
+ *
18
+ * @hidden
19
+ */
20
+ load(data) {
21
+ BaseVideoParser_1.BaseVideoParser.loadBaseVideo(this, data);
22
+ return this;
23
+ }
24
+ /**
25
+ * Video / playlist to play next after this video, alias to
26
+ * ```js
27
+ * video.related.items[0]
28
+ * ```
29
+ */
30
+ get upNext() {
31
+ return this.related.items[0];
32
+ }
33
+ }
34
+ exports.BaseVideo = BaseVideo;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseVideoParser = void 0;
4
+ const common_1 = require("../../common");
5
+ const BaseChannel_1 = require("../BaseChannel");
6
+ const PlaylistCompact_1 = require("../PlaylistCompact");
7
+ const Thumbnails_1 = require("../Thumbnails");
8
+ const VideoCompact_1 = require("../VideoCompact");
9
+ class BaseVideoParser {
10
+ static loadBaseVideo(target, data) {
11
+ var _a, _b, _c;
12
+ const videoInfo = BaseVideoParser.parseRawData(data);
13
+ // Basic information
14
+ target.id = videoInfo.videoDetails.videoId;
15
+ target.title = videoInfo.videoDetails.title;
16
+ target.uploadDate = videoInfo.dateText.simpleText;
17
+ target.viewCount = +videoInfo.videoDetails.viewCount || null;
18
+ target.isLiveContent = videoInfo.videoDetails.isLiveContent;
19
+ target.thumbnails = new Thumbnails_1.Thumbnails().load(videoInfo.videoDetails.thumbnail.thumbnails);
20
+ // Channel
21
+ const { title, thumbnail, subscriberCountText } = videoInfo.owner.videoOwnerRenderer;
22
+ target.channel = new BaseChannel_1.BaseChannel({
23
+ client: target.client,
24
+ id: title.runs[0].navigationEndpoint.browseEndpoint.browseId,
25
+ name: title.runs[0].text,
26
+ subscriberCount: subscriberCountText === null || subscriberCountText === void 0 ? void 0 : subscriberCountText.simpleText,
27
+ thumbnails: new Thumbnails_1.Thumbnails().load(thumbnail.thumbnails),
28
+ });
29
+ // Like Count and Dislike Count
30
+ const topLevelButtons = videoInfo.videoActions.menuRenderer.topLevelButtons;
31
+ target.likeCount = common_1.stripToInt(BaseVideoParser.parseButtonRenderer(topLevelButtons[0]));
32
+ // Tags and description
33
+ target.tags =
34
+ ((_b = (_a = videoInfo.superTitleLink) === null || _a === void 0 ? void 0 : _a.runs) === null || _b === void 0 ? void 0 : _b.map((r) => r.text.trim()).filter((t) => t)) || [];
35
+ target.description =
36
+ ((_c = videoInfo.description) === null || _c === void 0 ? void 0 : _c.runs.map((d) => d.text).join("")) || "";
37
+ // related videos
38
+ const secondaryContents = data[3].response.contents.twoColumnWatchNextResults.secondaryResults.secondaryResults
39
+ .results;
40
+ if (secondaryContents) {
41
+ target.related.items = BaseVideoParser.parseRelatedFromSecondaryContent(secondaryContents, target.client);
42
+ target.related.continuation = common_1.getContinuationFromItems(secondaryContents);
43
+ }
44
+ return target;
45
+ }
46
+ static parseRelated(data, client) {
47
+ const secondaryContents = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems;
48
+ return BaseVideoParser.parseRelatedFromSecondaryContent(secondaryContents, client);
49
+ }
50
+ static parseContinuation(data) {
51
+ const secondaryContents = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems;
52
+ return common_1.getContinuationFromItems(secondaryContents);
53
+ }
54
+ static parseRawData(data) {
55
+ const contents = data[3].response.contents.twoColumnWatchNextResults.results.results.contents;
56
+ const primaryInfo = contents.find((c) => "videoPrimaryInfoRenderer" in c)
57
+ .videoPrimaryInfoRenderer;
58
+ const secondaryInfo = contents.find((c) => "videoSecondaryInfoRenderer" in c).videoSecondaryInfoRenderer;
59
+ const videoDetails = data[2].playerResponse.videoDetails;
60
+ return Object.assign(Object.assign(Object.assign({}, secondaryInfo), primaryInfo), { videoDetails });
61
+ }
62
+ static parseCompactRenderer(data, client) {
63
+ if ("compactVideoRenderer" in data) {
64
+ return new VideoCompact_1.VideoCompact({ client }).load(data.compactVideoRenderer);
65
+ }
66
+ else if ("compactRadioRenderer" in data) {
67
+ return new PlaylistCompact_1.PlaylistCompact({ client }).load(data.compactRadioRenderer);
68
+ }
69
+ }
70
+ static parseRelatedFromSecondaryContent(secondaryContents, client) {
71
+ return secondaryContents
72
+ .map((c) => BaseVideoParser.parseCompactRenderer(c, client))
73
+ .filter((c) => c !== undefined);
74
+ }
75
+ static parseButtonRenderer(data) {
76
+ var _a;
77
+ const buttonRenderer = data.toggleButtonRenderer || data.buttonRenderer;
78
+ const accessibilityData = (((_a = buttonRenderer.defaultText) === null || _a === void 0 ? void 0 : _a.accessibility) || buttonRenderer.accessibilityData).accessibilityData;
79
+ return accessibilityData.label;
80
+ }
81
+ }
82
+ exports.BaseVideoParser = BaseVideoParser;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.VideoRelated = void 0;
13
+ const constants_1 = require("../../constants");
14
+ const Continuable_1 = require("../Continuable");
15
+ const BaseVideoParser_1 = require("./BaseVideoParser");
16
+ /**
17
+ * {@link Continuable} of related videos inside a Video
18
+ */
19
+ class VideoRelated extends Continuable_1.Continuable {
20
+ /** @hidden */
21
+ constructor({ video, client }) {
22
+ super({ client });
23
+ this.video = video;
24
+ }
25
+ fetch() {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const response = yield this.client.http.post(`${constants_1.I_END_POINT}/next`, {
28
+ data: { continuation: this.continuation },
29
+ });
30
+ const items = BaseVideoParser_1.BaseVideoParser.parseRelated(response.data, this.client);
31
+ const continuation = BaseVideoParser_1.BaseVideoParser.parseContinuation(response.data);
32
+ return {
33
+ continuation,
34
+ items,
35
+ };
36
+ });
37
+ }
38
+ }
39
+ exports.VideoRelated = VideoRelated;
@@ -1,21 +1,15 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.http = void 0;
17
- var http_1 = require("./http");
18
- Object.defineProperty(exports, "http", { enumerable: true, get: function () { return __importDefault(http_1).default; } });
19
- __exportStar(require("./helper"), exports);
20
- __exportStar(require("./types"), exports);
21
- __exportStar(require("./decorators"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./BaseVideo"), exports);
14
+ __exportStar(require("./BaseVideoParser"), exports);
15
+ __exportStar(require("./VideoRelated"), exports);
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Channel = void 0;
4
+ const BaseChannel_1 = require("../BaseChannel");
5
+ const ChannelParser_1 = require("./ChannelParser");
6
+ /** Represents a Youtube Channel */
7
+ class Channel extends BaseChannel_1.BaseChannel {
8
+ /** @hidden */
9
+ constructor(attr) {
10
+ super(attr);
11
+ this.shelves = [];
12
+ Object.assign(this, attr);
13
+ }
14
+ /**
15
+ * Load this instance with raw data from Youtube
16
+ *
17
+ * @hidden
18
+ */
19
+ load(data) {
20
+ ChannelParser_1.ChannelParser.loadChannel(this, data);
21
+ return this;
22
+ }
23
+ }
24
+ exports.Channel = Channel;