mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
This commit is contained in:
parent
491cb50219
commit
0eb4f6b267
@ -35,21 +35,23 @@ class TikTokBridge extends BridgeAbstract
|
|||||||
foreach ($videos as $video) {
|
foreach ($videos as $video) {
|
||||||
$item = [];
|
$item = [];
|
||||||
|
|
||||||
// Handle link "untracking"
|
// Omit query string (remove tracking parameters)
|
||||||
$linkParts = parse_url($video->find('a', 0)->href);
|
$a = $video->find('a', 0);
|
||||||
$link = $linkParts['scheme'] . '://' . $linkParts['host'] . '/' . $linkParts['path'];
|
$href = $a->href;
|
||||||
|
$parsedUrl = parse_url($href);
|
||||||
|
$url = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/' . ltrim($parsedUrl['path'], '/');
|
||||||
|
|
||||||
$image = $video->find('video', 0)->poster;
|
$image = $video->find('video', 0)->poster;
|
||||||
$views = $video->find('div[data-e2e=common-Video-Count]', 0)->plaintext;
|
$views = $video->find('div[data-e2e=common-Video-Count]', 0)->plaintext;
|
||||||
|
|
||||||
$enclosures = [$image];
|
$enclosures = [$image];
|
||||||
|
|
||||||
$item['uri'] = $link;
|
$item['uri'] = $url;
|
||||||
$item['title'] = 'Video';
|
$item['title'] = 'Video';
|
||||||
$item['author'] = '@' . $author;
|
$item['author'] = '@' . $author;
|
||||||
$item['enclosures'] = $enclosures;
|
$item['enclosures'] = $enclosures;
|
||||||
$item['content'] = <<<EOD
|
$item['content'] = <<<EOD
|
||||||
<a href="{$link}"><img src="{$image}"/></a>
|
<a href="{$url}"><img src="{$image}"/></a>
|
||||||
<p>{$views} views<p><br/>
|
<p>{$views} views<p><br/>
|
||||||
EOD;
|
EOD;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user