@@ -151,14 +151,14 @@ function getItem($id, $order, $continuationToken)
151
151
$ continuationTokenProvided = $ continuationToken != '' ;
152
152
153
153
if ($ options ['status ' ]) {
154
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id " , true );
154
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id " , forceLanguage: true , verifiesChannelRedirection: true );
155
155
$ status = $ result ['alerts ' ][0 ]['alertRenderer ' ]['text ' ]['simpleText ' ];
156
156
$ item ['status ' ] = $ status ;
157
157
}
158
158
159
159
if ($ options ['upcomingEvents ' ]) {
160
160
$ upcomingEvents = [];
161
- $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id " , verifiesChannelRedirection: true );
161
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id " , forceLanguage: true , verifiesChannelRedirection: true );
162
162
$ subItems = getTabs ($ result )[0 ]['tabRenderer ' ]['content ' ]['sectionListRenderer ' ]['contents ' ][0 ]['itemSectionRenderer ' ]['contents ' ][0 ]['shelfRenderer ' ]['content ' ]['horizontalListRenderer ' ]['items ' ];
163
163
foreach ($ subItems as $ subItem ) {
164
164
$ path = 'gridVideoRenderer/upcomingEventData ' ;
@@ -175,7 +175,7 @@ function getItem($id, $order, $continuationToken)
175
175
176
176
if ($ options ['shorts ' ]) {
177
177
if (!$ continuationTokenProvided ) {
178
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id/shorts " , true );
178
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id/shorts " , forceLanguage: true , verifiesChannelRedirection: true );
179
179
$ visitorData = getVisitorData ($ result );
180
180
$ tab = getTabByName ($ result , 'Shorts ' );
181
181
$ tabRenderer = $ tab ['tabRenderer ' ];
@@ -230,7 +230,7 @@ function getItem($id, $order, $continuationToken)
230
230
231
231
if ($ options ['community ' ]) {
232
232
if (!$ continuationTokenProvided ) {
233
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id/community " , true );
233
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id/community " , forceLanguage: true , verifiesChannelRedirection: true );
234
234
} else {
235
235
$ result = getContinuationJson ($ continuationToken );
236
236
}
@@ -258,7 +258,7 @@ function getItem($id, $order, $continuationToken)
258
258
259
259
if ($ options ['channels ' ]) {
260
260
if (!$ continuationTokenProvided ) {
261
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id/channels " , true );
261
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id/channels " , forceLanguage: true , verifiesChannelRedirection: true );
262
262
263
263
$ tab = getTabByName ($ result , 'Channels ' );
264
264
$ sectionListRenderer = $ tab ['tabRenderer ' ]['content ' ]['sectionListRenderer ' ];
@@ -323,7 +323,7 @@ function getItem($id, $order, $continuationToken)
323
323
}
324
324
325
325
if ($ options ['about ' ]) {
326
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id/about " , true );
326
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id/about " , forceLanguage: true , verifiesChannelRedirection: true );
327
327
328
328
$ c4TabbedHeaderRenderer = $ result ['header ' ]['c4TabbedHeaderRenderer ' ];
329
329
$ item ['countryChannelId ' ] = $ c4TabbedHeaderRenderer ['channelId ' ];
@@ -366,7 +366,7 @@ function getItem($id, $order, $continuationToken)
366
366
}
367
367
368
368
if ($ options ['approval ' ]) {
369
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id " , true );
369
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id " , forceLanguage: true , verifiesChannelRedirection: true );
370
370
$ item ['approval ' ] = end (explode (', ' , $ result ['header ' ]['pageHeaderRenderer ' ]['content ' ]['pageHeaderViewModel ' ]['title ' ]['dynamicTextViewModel ' ]['rendererContext ' ]['accessibilityContext ' ]['label ' ]));
371
371
}
372
372
@@ -385,7 +385,7 @@ function getItem($id, $order, $continuationToken)
385
385
386
386
if ($ options ['playlists ' ]) {
387
387
if (!$ continuationTokenProvided ) {
388
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id/playlists " , true );
388
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id/playlists " , forceLanguage: true , verifiesChannelRedirection: true );
389
389
390
390
$ tab = getTabByName ($ result , 'Playlists ' );
391
391
if ($ tab === null ) {
@@ -526,7 +526,7 @@ function getItem($id, $order, $continuationToken)
526
526
if ($ options ['letsPlay ' ])
527
527
{
528
528
$ letsPlay = [];
529
- $ result = getJSONFromHTMLForcingLanguage ("https://www.youtube.com/channel/ $ id/letsplay " );
529
+ $ result = getJSONFromHTML ("https://www.youtube.com/channel/ $ id/letsplay " , forceLanguage: true );
530
530
$ gridRendererItems = getTabByName ($ result , 'Let \'s play ' )['tabRenderer ' ]['content ' ]['sectionListRenderer ' ]['contents ' ][0 ]['itemSectionRenderer ' ]['contents ' ][0 ]['shelfRenderer ' ]['content ' ]['gridRenderer ' ]['items ' ];
531
531
foreach ($ gridRendererItems as $ gridRendererItem )
532
532
{
@@ -602,7 +602,7 @@ function getVideos(&$item, $url, $getGridRendererItems, $continuationToken)
602
602
{
603
603
$ videos = [];
604
604
if ($ continuationToken === '' ) {
605
- $ result = getJSONFromHTMLForcingLanguage ($ url );
605
+ $ result = getJSONFromHTML ($ url, forceLanguage: true );
606
606
$ gridRendererItems = $ getGridRendererItems ($ result );
607
607
$ visitorData = getVisitorData ($ result );
608
608
}
0 commit comments