summaryrefslogtreecommitdiff
path: root/providers/Youtube.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2025-07-02 16:08:51 +0200
committeremkael <emkael@tlen.pl>2025-07-02 16:08:51 +0200
commit37d66cf57321abf56703c32bd3a61a1dd029e296 (patch)
tree6964939b2e353beec015d3d28ab0ea6f96ed761c /providers/Youtube.php
parent215e174305ef33d7733406bbf19a23bd2c892b41 (diff)
Extracting description links from all RSS-type content, not only YouTube
Diffstat (limited to 'providers/Youtube.php')
-rw-r--r--providers/Youtube.php30
1 files changed, 0 insertions, 30 deletions
diff --git a/providers/Youtube.php b/providers/Youtube.php
index 03d0e27..4230c09 100644
--- a/providers/Youtube.php
+++ b/providers/Youtube.php
@@ -25,36 +25,6 @@ class Youtube extends Rss {
return '../cache/youtube.%s';
}
- protected function _mapRssItem($item) {
- $itemObj = parent::_mapRssItem($item);
- if (array_key_exists('descriptionlink', $this->_options)) {
- $linkConfig = explode(':', $this->_options['descriptionlink']);
- $linkDomain = NULL;
- if (!is_numeric($linkConfig[0])) {
- $linkDomain = array_shift($linkConfig);
- if (!$linkConfig) {
- $linkConfig = ['1'];
- }
- }
- $linkIndex = intval($linkConfig[0]) - 1;
- $textLinks = [];
- if (preg_match_all('#(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+#', $itemObj->Text, $textLinks)) {
- $textLinks = $textLinks[0];
- if ($linkDomain) {
- $textLinks = array_values(array_filter($textLinks, function($link) use($linkDomain) {
- if($linkParts = parse_url($link)) {
- return $linkParts['host'] == $linkDomain;
- }
- }));
- }
- if (count($textLinks) > $linkIndex) {
- $itemObj->Link = $textLinks[$linkIndex];
- }
- }
- }
- return $itemObj;
- }
-
private function _getVideoMetadata($ids) {
$cacheFile = sprintf($this->_getCachePath() . '.metadata', $this->_feed);
$cacheData = [];