rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

Youtube Bridge min_duration and max_duration are broken

Open velaja opened this issue 5 years ago • 7 comments

description: adding a value to either min_duration or max_duration will break the feed output.

To Reproduce Steps to reproduce the behavior:

  1. enter a valid channel id
  2. add min_duration=1 or max_duration=400
  3. click "html" output
  4. no ouput
  5. 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

velaja avatar Feb 24 '20 13:02 velaja

Seems like there is also a problem on Youtub search ...

Riduidel avatar Feb 29 '20 16:02 Riduidel

Will try to get a look at this, if nobody has done so before

Riduidel avatar Feb 29 '20 16:02 Riduidel

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

Riduidel avatar Feb 29 '20 16:02 Riduidel

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).

Riduidel avatar Feb 29 '20 17:02 Riduidel

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>

velaja avatar Mar 01 '20 07:03 velaja

This bug been resolved ?

Drakone avatar Nov 21 '20 21:11 Drakone

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.

yamanq avatar May 08 '22 18:05 yamanq

still actual issue. if min_duration/max_duration specified, feed is empty. reproduced on rss-bridge version dev.2022-06-14 (git.master.936ae8c)

karrakoliko avatar Dec 17 '22 02:12 karrakoliko

@em92, you marked as a maintainer of this bridge, could you take a look?

karrakoliko avatar Dec 17 '22 02:12 karrakoliko

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

dvikan avatar Dec 17 '22 08:12 dvikan

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

csisoap avatar Dec 18 '22 02:12 csisoap

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!

karrakoliko avatar Dec 18 '22 03:12 karrakoliko