Youtube Bridge min_duration and max_duration are broken
description: adding a value to either min_duration or max_duration will break the feed output.
To Reproduce Steps to reproduce the behavior:
- enter a valid channel id
- add min_duration=1 or max_duration=400
- click "html" output
- no ouput
- go back try without any value set for min_duration or max_duration and the feed shows up as expected
reproducible on several independent instances
Seems like there is also a problem on Youtub search ...
Will try to get a look at this, if nobody has done so before
Confirmed with channel id UC-4uelKAWhQCuktowofw4aA
Entering no min duration returns correctly the page
Entering min duration of 1 renders an empty page
Apache error logs indicates no specific error, but rather quite mundane log messages
Seems like there is a link with implementation of #670 by @LogMANOriginal : the skipFeeds() method seems to be called somewhere it shouldn't be. More precisely, check this line (in `bridges/YoutubeBridge.php#collectData()@236)
if(!empty($url_feed) && !empty($url_listing)) {
if(!$this->skipFeeds() && $xml = $this->ytGetSimpleHTMLDOM($url_feed)) {
$this->ytBridgeParseXmlFeed($xml);
If I remove the $this->skipFeeds() call, all of a sudden, it starts to work (at least for users and channels).
If I remove the
$this->skipFeeds()call, all of a sudden, it starts to work (at least for users and channels).
this is in essence what I wrote in the bug issue "5. go back try without any value set for min_duration or max_duration and the feed shows up as expected"
when you remove skipFeeds you basically remove duration filters and the entire feed shows as expected
I think the problem is here:
$durationText = trim($element->find('div.timestamp span', 0)->plaintext);
the div.timestamp span does not exists on the youtube page anymore
it should look for something like:
<span class="style-scope ytd-thumbnail-overlay-time-status-renderer" aria-label="12 minutes, 14 seconds">12:14</span>
This bug been resolved ?
I cannot reproduce this issue on my private instance. It's possible that the error is the result of rate limiting or that it has been resolved.
still actual issue. if min_duration/max_duration specified, feed is empty. reproduced on rss-bridge version dev.2022-06-14 (git.master.936ae8c)
@em92, you marked as a maintainer of this bridge, could you take a look?
The problem is here:
diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php
index 7aa101e7..0879c7dc 100644
--- a/bridges/YoutubeBridge.php
+++ b/bridges/YoutubeBridge.php
@@ -350,6 +350,9 @@ class YoutubeBridge extends BridgeAbstract
if (isset($jsonData->contents)) {
$channel_id = $jsonData->metadata->channelMetadataRenderer->externalId;
$jsonData = $jsonData->contents->twoColumnBrowseResultsRenderer->tabs[1];
+ if (!isset($jsonData->tabRenderer->content->sectionListRenderer)) {
+ throw new \Exception('Unable to parse json data');
+ }
$jsonData = $jsonData->tabRenderer->content->sectionListRenderer->contents[0];
$jsonData = $jsonData->itemSectionRenderer->contents[0]->gridRenderer->items;
$this->parseJSONListing($jsonData);
@csisoap ping
The problem is here:
diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index 7aa101e7..0879c7dc 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -350,6 +350,9 @@ class YoutubeBridge extends BridgeAbstract if (isset($jsonData->contents)) { $channel_id = $jsonData->metadata->channelMetadataRenderer->externalId; $jsonData = $jsonData->contents->twoColumnBrowseResultsRenderer->tabs[1]; + if (!isset($jsonData->tabRenderer->content->sectionListRenderer)) { + throw new \Exception('Unable to parse json data'); + } $jsonData = $jsonData->tabRenderer->content->sectionListRenderer->contents[0]; $jsonData = $jsonData->itemSectionRenderer->contents[0]->gridRenderer->items; $this->parseJSONListing($jsonData);@csisoap ping
I have pushed a fix at #3192
The problem is here:
diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index 7aa101e7..0879c7dc 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -350,6 +350,9 @@ class YoutubeBridge extends BridgeAbstract if (isset($jsonData->contents)) { $channel_id = $jsonData->metadata->channelMetadataRenderer->externalId; $jsonData = $jsonData->contents->twoColumnBrowseResultsRenderer->tabs[1]; + if (!isset($jsonData->tabRenderer->content->sectionListRenderer)) { + throw new \Exception('Unable to parse json data'); + } $jsonData = $jsonData->tabRenderer->content->sectionListRenderer->contents[0]; $jsonData = $jsonData->itemSectionRenderer->contents[0]->gridRenderer->items; $this->parseJSONListing($jsonData);@csisoap ping
I have pushed a fix at #3192
it works, thank you, guys!