mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 07:09:54 +03:00
[YouTubeCommunityTabBridge] Improve JSON extraction (#4140)
Small change that should make the extraction of JSON from HTML work more reliably
This commit is contained in:
parent
2a84350cb2
commit
adad9d6405
1 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ class YouTubeCommunityTabBridge extends BridgeAbstract
|
|||
private $itemTitle = '';
|
||||
|
||||
private $urlRegex = '/youtube\.com\/(channel|user|c)\/([\w]+)\/community/';
|
||||
private $jsonRegex = '/var ytInitialData = (.*);<\/script>/';
|
||||
private $jsonRegex = '/var ytInitialData = ([^<]*);<\/script>/';
|
||||
|
||||
public function detectParameters($url)
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ class YouTubeCommunityTabBridge extends BridgeAbstract
|
|||
$html = getSimpleHTMLDOM($this->feedUrl);
|
||||
}
|
||||
|
||||
$json = $this->extractJson($html->find('body', 0)->innertext);
|
||||
$json = $this->extractJson($html->find('html', 0)->innertext);
|
||||
|
||||
$this->feedName = $json->header->c4TabbedHeaderRenderer->title;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue