mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
Added codec of the attached file
This commit is contained in:
parent
8325294e65
commit
e8895b1752
@ -65,6 +65,7 @@ class YoutubeBridge extends BridgeAbstract{
|
|||||||
$item->uri = 'https://www.youtube.com'.$element->find('a',0)->href;
|
$item->uri = 'https://www.youtube.com'.$element->find('a',0)->href;
|
||||||
$item->thumbnailUri = 'https:'.$element->find('img',0)->src;
|
$item->thumbnailUri = 'https:'.$element->find('img',0)->src;
|
||||||
$item->attachment = htmlspecialchars($video);
|
$item->attachment = htmlspecialchars($video);
|
||||||
|
$item->attachmentCodec = "video/mp4";
|
||||||
$item->title = trim($element->find('h3',0)->plaintext);
|
$item->title = trim($element->find('h3',0)->plaintext);
|
||||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>';
|
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>';
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
|
@ -26,6 +26,7 @@ class AtomFormat extends FormatAbstract{
|
|||||||
$entryTitle = is_null($data->title) ? '' : $data->title;
|
$entryTitle = is_null($data->title) ? '' : $data->title;
|
||||||
$entryUri = is_null($data->uri) ? '' : $data->uri;
|
$entryUri = is_null($data->uri) ? '' : $data->uri;
|
||||||
$entryAttachment = is_null($data->attachment) ? '' : $data->attachment;
|
$entryAttachment = is_null($data->attachment) ? '' : $data->attachment;
|
||||||
|
$entryAttachmentCodec = is_null($data->attachmentCodec) ? '' : $data->attachmentCodec;
|
||||||
$entryTimestamp = is_null($data->timestamp) ? date(DATE_ATOM, 0) : date(DATE_ATOM, $data->timestamp);
|
$entryTimestamp = is_null($data->timestamp) ? date(DATE_ATOM, 0) : date(DATE_ATOM, $data->timestamp);
|
||||||
$timestamps[] = (int)$entryTimestamp;
|
$timestamps[] = (int)$entryTimestamp;
|
||||||
// We prevent content from closing the CDATA too early.
|
// We prevent content from closing the CDATA too early.
|
||||||
@ -43,7 +44,7 @@ class AtomFormat extends FormatAbstract{
|
|||||||
<id>{$entryUri}</id>
|
<id>{$entryUri}</id>
|
||||||
<updated>{$entryTimestamp}</updated>
|
<updated>{$entryTimestamp}</updated>
|
||||||
<content type="html">{$entryContent}</content>
|
<content type="html">{$entryContent}</content>
|
||||||
<link rel="enclosure" href="{$entryAttachment}" />
|
<link rel="enclosure" href="{$entryAttachment}" type="{$entryAttachmentCodec}" />
|
||||||
</entry>
|
</entry>
|
||||||
|
|
||||||
EOD;
|
EOD;
|
||||||
|
Loading…
Reference in New Issue
Block a user