|
@@ -28,15 +28,16 @@ hexo.extend.helper.register('is_video_provider', function(url, provider){
|
|
url = url.replace('http://', '')
|
|
url = url.replace('http://', '')
|
|
url = url.replace('https://', '')
|
|
url = url.replace('https://', '')
|
|
url = url.replace('www', '')
|
|
url = url.replace('www', '')
|
|
- var parts = url.split('.');
|
|
|
|
- return parts[0] == provider ? true : false;
|
|
|
|
|
|
+ return url.includes(provider)
|
|
});
|
|
});
|
|
|
|
|
|
hexo.extend.helper.register('youtube_embed_link', function(url){
|
|
hexo.extend.helper.register('youtube_embed_link', function(url){
|
|
url = url.replace('http://', '')
|
|
url = url.replace('http://', '')
|
|
url = url.replace('https://', '')
|
|
url = url.replace('https://', '')
|
|
|
|
+ url = url.replace('watch?v=', '')
|
|
|
|
+ url = url.replace(' ', '')
|
|
var parts = url.split('/');
|
|
var parts = url.split('/');
|
|
- return `http://www.youtube.com/embed/${parts[2]}`;
|
|
|
|
|
|
+ return `https://www.youtube.com/embed/${parts[1]}`;
|
|
});
|
|
});
|
|
|
|
|
|
hexo.extend.helper.register('vimeo_embed_link', function(url){
|
|
hexo.extend.helper.register('vimeo_embed_link', function(url){
|