Embedding youtube videos is working again, removed Oohembed as generic provider.

This commit is contained in:
Mario Hommel 2021-01-09 15:05:17 +01:00
parent 222ccc11b4
commit 927c2df12e
5 changed files with 17 additions and 27 deletions

View file

@ -1,3 +1,10 @@
Version 1.20
-----------------------
* Fixed wrong API-Endpoint for youtube
* Removed generic provider oohembed (service shutdown)
* Removed wordpress player for AudioBoo (no more flash)
* Changed info for generic provider embed.ly (free plan is no longer available)
Version 1.15
-----------------------
* Fixed PHP warning caused by typo in template

View file

@ -15,12 +15,11 @@
@define('PLUGIN_EVENT_OEMBED_MAXHEIGHT_DESC','This is the max height the service should produce when providing a replacement. Not all services supports this but most.');
@define('PLUGIN_EVENT_OEMBED_GENERIC_SERVICE', 'Generic oEmbed provider');
@define('PLUGIN_EVENT_OEMBED_GENERIC_SERVICE_DESC','If the plugin is not able to resolve an URL because it is unknown yet, you may let it fall back to a "generic provider". These services implements oEmbed for a huge amount of services not having oEmbed. You have two choices: oohembed.com, a former free service bought by embedly and with a very limited API rate now. embed.ly is a very well maintained service for many oEmbed services (see http://embed.ly/providers), but it needs an API key to be used.');
@define('PLUGIN_EVENT_OEMBED_GENERIC_SERVICE_DESC','If the plugin is not able to resolve an URL because it is unknown yet, you may let it fall back to a "generic provider". These services implements oEmbed for a huge amount of services not having oEmbed. You can choose to have no generic provider or use embed.ly which is a very well maintained service for many oEmbed services (see http://embed.ly/providers), but it needs an API key with a paid plan.');
@define('PLUGIN_EVENT_OEMBED_SERVICE_NONE', 'No generic provider');
@define('PLUGIN_EVENT_OEMBED_SERVICE_OOHEMBED', 'oohembed (free but limited)');
@define('PLUGIN_EVENT_OEMBED_SERVICE_EMBEDLY', 'embed.ly (apikey needed)');
@define('PLUGIN_EVENT_OEMBED_EMBEDLY_APIKEY', 'embed.ly API key');
@define('PLUGIN_EVENT_OEMBED_EMBEDLY_APIKEY_DESC','embed.ly needs an API key to be used. The free account allows 10k calls per month atm, what should be enough even for heavy used blogs, as the results are cached localy and fetched only once per URL. You can register for your free account at http://app.embed.ly/pricing/free');
@define('PLUGIN_EVENT_OEMBED_EMBEDLY_APIKEY_DESC','embed.ly needs an API key to be used. You need a paid plan to use this provider. Look for an account at https://embed.ly');
@define('PLUGIN_EVENT_OEMBED_INFO', '<h3>oEmbed Plugin</h3>' .
'<p>'.
@ -40,4 +39,3 @@
@define('PLUGIN_EVENT_OEMBED_PLAYER_BOO_DESC', 'Audioboo supports 3 different players (see http://audioboo.fm/boos/649785-ein-erster-testboo.embed?labs=1). Choose the one you like most.');
@define('PLUGIN_EVENT_OEMBED_PLAYER_BOO_STANDARD', 'standard player');
@define('PLUGIN_EVENT_OEMBED_PLAYER_BOO_FULLFEATURED', 'full-featured (requires JavaScript)');
@define('PLUGIN_EVENT_OEMBED_PLAYER_BOO_WORDPRESS', 'wordpress.com player (requires Flash)');

View file

@ -1,11 +0,0 @@
<?php
class OohEmbedProvider extends OEmbedProvider {
public function match($url){
// Embedly should match always
return 1;
}
public function __construct($url, $maxwidth=null, $maxheight=null){
$endpoint = "http://oohembed.com/oohembed/";
parent::__construct($url,$endpoint,true, $maxwidth,$maxheight, true);
}
}

View file

@ -17,12 +17,14 @@
<provider>
<name>Youtube</name>
<url>https?://*.youtube.com/*</url>
<endpoint>http://www.youtube.com/oembed</endpoint>
<jsononly/>
<endpoint>https://www.youtube.com/oembed?</endpoint>
</provider>
<provider>
<name>Youtube short link</name>
<url>https?://*.youtu.be/*</url>
<endpoint>http://www.youtube.com/oembed</endpoint>
<jsononly/>
<endpoint>https://www.youtube.com/oembed?</endpoint>
</provider>
<provider>
<name>SmugMug</name>

View file

@ -30,7 +30,7 @@ class serendipity_event_oembed extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_OEMBED_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Grischa Brockhaus');
$propbag->add('version', '1.15.1');
$propbag->add('version', '1.20');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -90,26 +90,24 @@ class serendipity_event_oembed extends serendipity_event
case 'generic_service':
$generic_services = array (
'none' => PLUGIN_EVENT_OEMBED_SERVICE_NONE,
'oohembed' => PLUGIN_EVENT_OEMBED_SERVICE_OOHEMBED,
'embedly' => PLUGIN_EVENT_OEMBED_SERVICE_EMBEDLY,
);
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_OEMBED_GENERIC_SERVICE);
$propbag->add('description', PLUGIN_EVENT_OEMBED_GENERIC_SERVICE_DESC);
$propbag->add('select_values', $generic_services);
$propbag->add('default', 'oohembed');
$propbag->add('default', 'none');
break;
case 'audioboo_player':
$player_boo = array (
'standard' => PLUGIN_EVENT_OEMBED_PLAYER_BOO_STANDARD,
'fullfeatured' => PLUGIN_EVENT_OEMBED_PLAYER_BOO_FULLFEATURED,
'wordpress' => PLUGIN_EVENT_OEMBED_PLAYER_BOO_WORDPRESS,
);
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_OEMBED_PLAYER_BOO);
$propbag->add('description', PLUGIN_EVENT_OEMBED_PLAYER_BOO_DESC);
$propbag->add('select_values', $player_boo);
$propbag->add('default', 'wordpress');
$propbag->add('default', 'standard');
break;
case 'embedly_apikey':
$propbag->add('type', 'string');
@ -236,11 +234,7 @@ class serendipity_event_oembed extends serendipity_event
function expand_by_general_provider($url, $maxwidth=null, $maxheight=null) {
$provider = $this->get_config('generic_service', 'none');
$manager = null;
if ('oohembed' == $provider) {
require_once dirname(__FILE__) . '/oembed/OohEmbedProvider.class.php';
$manager = new OohEmbedProvider($url, $maxwidth, $maxheight);
}
elseif ('embedly' == $provider) {
if ('embedly' == $provider) {
$apikey = $this->get_config('embedly_apikey', '');
if (!empty($apikey)) {
require_once dirname(__FILE__) . '/oembed/EmbedlyProvider.class.php';