mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-24 12:03:46 +03:00
fix(rumble): exterminate double leading slashes in item url (#4381)
Fixed for items with pub date newer than 31. jan 2025
This commit is contained in:
parent
97eebfb562
commit
e825272987
1 changed files with 9 additions and 6 deletions
|
@ -60,15 +60,10 @@ class RumbleBridge extends BridgeAbstract
|
|||
|
||||
$dom = getSimpleHTMLDOM($url);
|
||||
foreach ($dom->find('ol.thumbnail__grid div.thumbnail__grid--item') as $video) {
|
||||
$itemUrlString = self::URI . $video->find('a', 0)->href;
|
||||
$itemUrl = Url::fromString($itemUrlString);
|
||||
$href = $video->find('a', 0)->href;
|
||||
|
||||
$item = [
|
||||
'title' => $video->find('h3', 0)->plaintext,
|
||||
|
||||
// Remove tracking parameter in query string
|
||||
'uri' => $itemUrl->withQueryString(null)->__toString(),
|
||||
|
||||
'author' => $account . '@rumble.com',
|
||||
'content' => defaultLinkTo($video, self::URI)->innertext,
|
||||
];
|
||||
|
@ -78,6 +73,14 @@ class RumbleBridge extends BridgeAbstract
|
|||
$publishedAt = new \DateTimeImmutable($time->getAttribute('datetime'));
|
||||
$item['timestamp'] = $publishedAt->getTimestamp();
|
||||
}
|
||||
|
||||
if (isset($publishedAt) && $publishedAt > new \DateTimeImmutable('2025-01-31')) {
|
||||
$href = ltrim($href, '/');
|
||||
}
|
||||
$itemUrl = Url::fromString(self::URI . $href);
|
||||
// Remove tracking parameter in query string
|
||||
$item['uri'] = $itemUrl->withQueryString(null)->__toString();
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue