Spaces:
Sleeping
Sleeping
Upload 15 files
Browse files- lib/ytmusicapi.js +3 -3
- test.html +1 -1
lib/ytmusicapi.js
CHANGED
|
@@ -2,7 +2,7 @@ const axios = require('axios');
|
|
| 2 |
|
| 3 |
class YTMusic {
|
| 4 |
constructor() {
|
| 5 |
-
this.baseURL = 'https://
|
| 6 |
this.apiKey = 'AIzaSyC9XL3ZjWjXClIX1FmUxJq--EohcD4_oSs';
|
| 7 |
this.context = {
|
| 8 |
client: {
|
|
@@ -189,14 +189,14 @@ class YTMusic {
|
|
| 189 |
'User-Agent': this.context.client.userAgent,
|
| 190 |
'Content-Type': 'application/json',
|
| 191 |
'X-Goog-AuthUser': '0',
|
| 192 |
-
'X-Origin': 'https://
|
| 193 |
// Prefer stable headers; only send visitor if previously learned
|
| 194 |
...(this.visitorData ? { 'X-Goog-Visitor-Id': this.visitorData } : {}),
|
| 195 |
'X-YouTube-Client-Name': '67', // WEB_REMIX
|
| 196 |
'X-YouTube-Client-Version': this.context.client.clientVersion,
|
| 197 |
'Accept': '*/*',
|
| 198 |
'Accept-Language': 'en-US,en;q=0.9',
|
| 199 |
-
'Referer': 'https://
|
| 200 |
}
|
| 201 |
});
|
| 202 |
|
|
|
|
| 2 |
|
| 3 |
class YTMusic {
|
| 4 |
constructor() {
|
| 5 |
+
this.baseURL = 'https://summer-darkness-1435.bob17040246.workers.dev//youtubei/v1';
|
| 6 |
this.apiKey = 'AIzaSyC9XL3ZjWjXClIX1FmUxJq--EohcD4_oSs';
|
| 7 |
this.context = {
|
| 8 |
client: {
|
|
|
|
| 189 |
'User-Agent': this.context.client.userAgent,
|
| 190 |
'Content-Type': 'application/json',
|
| 191 |
'X-Goog-AuthUser': '0',
|
| 192 |
+
'X-Origin': 'https://summer-darkness-1435.bob17040246.workers.dev/',
|
| 193 |
// Prefer stable headers; only send visitor if previously learned
|
| 194 |
...(this.visitorData ? { 'X-Goog-Visitor-Id': this.visitorData } : {}),
|
| 195 |
'X-YouTube-Client-Name': '67', // WEB_REMIX
|
| 196 |
'X-YouTube-Client-Version': this.context.client.clientVersion,
|
| 197 |
'Accept': '*/*',
|
| 198 |
'Accept-Language': 'en-US,en;q=0.9',
|
| 199 |
+
'Referer': 'https://summer-darkness-1435.bob17040246.workers.dev/'
|
| 200 |
}
|
| 201 |
});
|
| 202 |
|
test.html
CHANGED
|
@@ -22,7 +22,7 @@
|
|
| 22 |
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
|
| 23 |
</style>
|
| 24 |
<script>
|
| 25 |
-
const base = '
|
| 26 |
|
| 27 |
function $(id) { return document.getElementById(id); }
|
| 28 |
function setJSON(id, value) { $(id).textContent = JSON.stringify(value, null, 2); }
|
|
|
|
| 22 |
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
|
| 23 |
</style>
|
| 24 |
<script>
|
| 25 |
+
const base = 'https://veltrixcode-ytm.hf.space';
|
| 26 |
|
| 27 |
function $(id) { return document.getElementById(id); }
|
| 28 |
function setJSON(id, value) { $(id).textContent = JSON.stringify(value, null, 2); }
|