mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-18 14:22:38 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -3,24 +3,28 @@ class Arte7Bridge extends BridgeAbstract {
|
||||
|
||||
const MAINTAINER = 'mitsukarenai';
|
||||
const NAME = 'Arte +7';
|
||||
const URI = 'http://www.arte.tv/';
|
||||
const URI = 'https://www.arte.tv/';
|
||||
const CACHE_TIMEOUT = 1800; // 30min
|
||||
const DESCRIPTION = 'Returns newest videos from ARTE +7';
|
||||
|
||||
const API_TOKEN = 'Nzc1Yjc1ZjJkYjk1NWFhN2I2MWEwMmRlMzAzNjI5NmU3NWU3ODg4ODJjOWMxNTMxYzEzZGRjYjg2ZGE4MmIwOA';
|
||||
|
||||
const PARAMETERS = array(
|
||||
'Catégorie (Français)' => array(
|
||||
'catfr' => array(
|
||||
'type' => 'list',
|
||||
'name' => 'Catégorie',
|
||||
'values' => array(
|
||||
'Toutes les vidéos (français)' => 'toutes-les-videos',
|
||||
'Actu & société' => 'actu-société',
|
||||
'Séries & fiction' => 'séries-fiction',
|
||||
'Cinéma' => 'cinéma',
|
||||
'Arts & spectacles classiques' => 'arts-spectacles-classiques',
|
||||
'Culture pop' => 'culture-pop',
|
||||
'Découverte' => 'découverte',
|
||||
'Histoire' => 'histoire',
|
||||
'Junior' => 'junior'
|
||||
'Toutes les vidéos (français)' => null,
|
||||
'Actu & société' => 'ACT',
|
||||
'Séries & fiction' => 'SER',
|
||||
'Cinéma' => 'CIN',
|
||||
'Arts & spectacles classiques' => 'ARS',
|
||||
'Culture pop' => 'CPO',
|
||||
'Découverte' => 'DEC',
|
||||
'Histoire' => 'HIST',
|
||||
'Science' => 'SCI',
|
||||
'Autre' => 'AUT'
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -29,15 +33,16 @@ class Arte7Bridge extends BridgeAbstract {
|
||||
'type' => 'list',
|
||||
'name' => 'Catégorie',
|
||||
'values' => array(
|
||||
'Alle Videos (deutsch)' => 'alle-videos',
|
||||
'Aktuelles & Gesellschaft' => 'aktuelles-gesellschaft',
|
||||
'Fernsehfilme & Serien' => 'fernsehfilme-serien',
|
||||
'Kino' => 'kino',
|
||||
'Kunst & Kultur' => 'kunst-kultur',
|
||||
'Popkultur & Alternativ' => 'popkultur-alternativ',
|
||||
'Entdeckung' => 'entdeckung',
|
||||
'Geschichte' => 'geschichte',
|
||||
'Junior' => 'junior'
|
||||
'Alle Videos (deutsch)' => null,
|
||||
'Aktuelles & Gesellschaft' => 'ACT',
|
||||
'Fernsehfilme & Serien' => 'SER',
|
||||
'Kino' => 'CIN',
|
||||
'Kunst & Kultur' => 'ARS',
|
||||
'Popkultur & Alternativ' => 'CPO',
|
||||
'Entdeckung' => 'DEC',
|
||||
'Geschichte' => 'HIST',
|
||||
'Wissenschaft' => 'SCI',
|
||||
'Sonstiges' => 'AUT'
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -55,44 +60,39 @@ class Arte7Bridge extends BridgeAbstract {
|
||||
break;
|
||||
}
|
||||
|
||||
$url = self::URI . 'guide/' . $lang . '/plus7/' . $category;
|
||||
$input = getContents($url) or die('Could not request ARTE.');
|
||||
$url = 'https://api.arte.tv/api/opa/v3/videos?sort=broadcastBegin&limit=10&language='
|
||||
. $lang
|
||||
. ($category != null ? '&category.code=' . $category : '');
|
||||
|
||||
if(strpos($input, 'categoryVideoSet') !== false) {
|
||||
$input = explode('categoryVideoSet="', $input);
|
||||
$input = explode('}}', $input[1]);
|
||||
$input = $input[0] . '}}';
|
||||
} else {
|
||||
$input = explode('videoSet="', $input);
|
||||
$input = explode('}]}', $input[1]);
|
||||
$input = $input[0] . '}]}';
|
||||
}
|
||||
$context = array(
|
||||
'http' => array(
|
||||
'header' => 'Authorization: Bearer '. self::API_TOKEN
|
||||
)
|
||||
);
|
||||
|
||||
$input_json = json_decode(html_entity_decode($input, ENT_QUOTES), true);
|
||||
$input = getContents($url, false, stream_context_create($context)) or die('Could not request ARTE.');
|
||||
$input_json = json_decode($input, true);
|
||||
|
||||
foreach($input_json['videos'] as $element) {
|
||||
|
||||
$item = array();
|
||||
$item['uri'] = str_replace("autoplay=1", "", $element['url']);
|
||||
$item['uri'] = $element['url'];
|
||||
$item['id'] = $element['id'];
|
||||
|
||||
$hack_broadcast_time = $element['rights_end'];
|
||||
$hack_broadcast_time = strtok($hack_broadcast_time, 'T');
|
||||
$hack_broadcast_time = strtok('T');
|
||||
|
||||
$item['timestamp'] = strtotime($element['scheduled_on'] . 'T' . $hack_broadcast_time);
|
||||
$item['timestamp'] = strtotime($element['videoRightsBegin']);
|
||||
$item['title'] = $element['title'];
|
||||
|
||||
if(!empty($element['subtitle']))
|
||||
$item['title'] = $element['title'] . ' | ' . $element['subtitle'];
|
||||
|
||||
$item['duration'] = round((int)$element['duration'] / 60);
|
||||
$item['content'] = $element['teaser']
|
||||
$item['duration'] = round((int)$element['durationSeconds'] / 60);
|
||||
$item['content'] = $element['teaserText']
|
||||
. '<br><br>'
|
||||
. $item['duration']
|
||||
. 'min<br><a href="'
|
||||
. $item['uri']
|
||||
. '"><img src="'
|
||||
. $element['thumbnail_url']
|
||||
. $element['mainImage']['url']
|
||||
. '" /></a>';
|
||||
|
||||
$this->items[] = $item;
|
||||
|
@@ -20,7 +20,7 @@ class GoComicsBridge extends BridgeAbstract {
|
||||
|
||||
foreach($html->find('div.comic__container') as $element) {
|
||||
|
||||
$img = $element->find('img', 0);
|
||||
$img = $element->find('.item-comic-image img', 0);
|
||||
$link = $element->find('a.js-item-comic-link', 0);
|
||||
$comic = $img->src;
|
||||
$title = $link->title;
|
||||
|
@@ -3,7 +3,7 @@ class Torrent9Bridge extends BridgeAbstract {
|
||||
|
||||
const MAINTAINER = 'lagaisse';
|
||||
const NAME = 'Torrent9 Bridge';
|
||||
const URI = 'http://www.torrent9.biz';
|
||||
const URI = 'http://www.torrent9.pe';
|
||||
const CACHE_TIMEOUT = 86400; // 24h = 86400s
|
||||
const DESCRIPTION = 'Returns latest torrents';
|
||||
|
||||
|
@@ -44,6 +44,25 @@ class TwitterBridge extends BridgeAbstract {
|
||||
'type' => 'checkbox',
|
||||
'title' => 'Hide retweets'
|
||||
)
|
||||
),
|
||||
'By list' => array(
|
||||
'user' => array(
|
||||
'name' => 'User',
|
||||
'required' => true,
|
||||
'exampleValue' => 'sebsauvage',
|
||||
'title' => 'Insert a user name'
|
||||
),
|
||||
'list' => array(
|
||||
'name' => 'List',
|
||||
'required' => true,
|
||||
'title' => 'Insert the list name'
|
||||
),
|
||||
'filter' => array(
|
||||
'name' => 'Filter',
|
||||
'exampleValue' => '#rss-bridge',
|
||||
'required' => false,
|
||||
'title' => 'Specify term to search for'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -57,6 +76,10 @@ class TwitterBridge extends BridgeAbstract {
|
||||
$specific = '@';
|
||||
$param = 'u';
|
||||
break;
|
||||
case 'By list':
|
||||
$specific = $this->getInput('user');
|
||||
$param = 'list';
|
||||
break;
|
||||
default: return parent::getName();
|
||||
}
|
||||
return 'Twitter ' . $specific . $this->getInput($param);
|
||||
@@ -74,6 +97,11 @@ class TwitterBridge extends BridgeAbstract {
|
||||
. urlencode($this->getInput('u'));
|
||||
// Always return without replies!
|
||||
// . ($this->getInput('norep') ? '' : '/with_replies');
|
||||
case 'By list':
|
||||
return self::URI
|
||||
. urlencode($this->getInput('user'))
|
||||
. '/lists/'
|
||||
. str_replace(' ', '-', strtolower($this->getInput('list')));
|
||||
default: return parent::getURI();
|
||||
}
|
||||
}
|
||||
@@ -88,6 +116,8 @@ class TwitterBridge extends BridgeAbstract {
|
||||
returnServerError('No results for this query.');
|
||||
case 'By username':
|
||||
returnServerError('Requested username can\'t be found.');
|
||||
case 'By list':
|
||||
returnServerError('Requested username or list can\'t be found');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +162,18 @@ class TwitterBridge extends BridgeAbstract {
|
||||
// generate the title
|
||||
$item['title'] = strip_tags($this->fixAnchorSpacing($tweet->find('p.js-tweet-text', 0), '<a>'));
|
||||
|
||||
switch($this->queriedContext) {
|
||||
case 'By list':
|
||||
// Check if filter applies to list (using raw content)
|
||||
if(!is_null($this->getInput('filter'))) {
|
||||
if(stripos($tweet->find('p.js-tweet-text', 0)->plaintext, $this->getInput('filter')) === false) {
|
||||
continue 2; // switch + for-loop!
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
$this->processContentLinks($tweet);
|
||||
$this->processEmojis($tweet);
|
||||
|
||||
|
@@ -88,7 +88,8 @@ class YoutubeBridge extends BridgeAbstract {
|
||||
|
||||
$vid = str_replace('yt:video:', '', $element->find('id', 0)->plaintext);
|
||||
$time = strtotime($element->find('published', 0)->plaintext);
|
||||
$this->ytBridgeAddItem($vid, $title, $author, $desc, $time);
|
||||
if(strpos($vid, 'googleads') === false)
|
||||
$this->ytBridgeAddItem($vid, $title, $author, $desc, $time);
|
||||
}
|
||||
$this->request = $this->ytBridgeFixTitle($xml->find('feed > title', 0)->plaintext);
|
||||
}
|
||||
@@ -104,7 +105,7 @@ class YoutubeBridge extends BridgeAbstract {
|
||||
$vid = str_replace('/watch?v=', '', $element->find('a', 0)->href);
|
||||
$vid = substr($vid, 0, strpos($vid, '&') ?: strlen($vid));
|
||||
$title = $this->ytBridgeFixTitle($element->find($title_selector, 0)->plaintext);
|
||||
if($title != '[Private Video]') {
|
||||
if($title != '[Private Video]' && strpos($vid, 'googleads') === false) {
|
||||
$this->ytBridgeQueryVideoInfo($vid, $author, $desc, $time);
|
||||
$this->ytBridgeAddItem($vid, $title, $author, $desc, $time);
|
||||
$count++;
|
||||
|
Reference in New Issue
Block a user