File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,6 @@ $ bun test
62
62
- [ ![ eslint-plugin-simple-import-sort] ( https://img.shields.io/badge/eslint--plugin--simple--import--sort-latest-red?style=flat-square )] ( https://npmjs.com/package/eslint-plugin-simple-import-sort/v/latest )
63
63
- [ ![ prettier] ( https://img.shields.io/badge/prettier-latest-red?style=flat-square )] ( https://npmjs.com/package/prettier/v/latest )
64
64
- Miscellaneous
65
- - [ ![ arktype] ( https://img.shields.io/badge/arktype-%5E1.0.28 --alpha-red?style=flat-square )] ( https://npmjs.com/package/arktype/v/1.0.28 -alpha )
65
+ - [ ![ arktype] ( https://img.shields.io/badge/arktype-%5E1.0.29 --alpha-red?style=flat-square )] ( https://npmjs.com/package/arktype/v/1.0.29 -alpha )
66
66
- [ ![ axios] ( https://img.shields.io/badge/axios-%5E0.27.2-red?style=flat-square )] ( https://npmjs.com/package/axios/v/0.27.2 )
67
67
- [ ![ tough-cookie] ( https://img.shields.io/badge/tough--cookie-%5E4.1.2-red?style=flat-square )] ( https://npmjs.com/package/tough-cookie/v/4.1.2 )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ytmusic-api" ,
3
- "version" : " 5.0.3 " ,
3
+ "version" : " 5.1.0 " ,
4
4
"description" : " YouTube Music API" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ export default class YTMusic {
77
77
/**
78
78
* Initializes the API
79
79
*/
80
- public async initialize ( cookies ?: string ) {
80
+ public async initialize ( options ?: { cookies ?: string ; GL ?: string ; HL ?: string } ) {
81
+ const { cookies, GL , HL } = options ?? { }
82
+
81
83
if ( cookies ) {
82
84
for ( const cookieString of cookies . split ( "; " ) ) {
83
85
const cookie = Cookie . parse ( `${ cookieString } ` )
@@ -108,6 +110,13 @@ export default class YTMusic {
108
110
}
109
111
}
110
112
113
+ if ( ! this . config ) {
114
+ this . config = { }
115
+ }
116
+
117
+ if ( GL ) this . config . GL = GL
118
+ if ( HL ) this . config . HL = HL
119
+
111
120
return this
112
121
}
113
122
You can’t perform that action at this time.
0 commit comments