Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
native YouTube handler: support https
Browse files Browse the repository at this point in the history
update youtube-dl compatibility to 2011.09.18c
don't force MPlayer for https
  • Loading branch information
chocolateboy committed Sep 25, 2011
1 parent 4efdbeb commit 3cfc621
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
5 changes: 5 additions & 0 deletions Changes
@@ -1,3 +1,8 @@
1.5.9 Sun Sep 25 11:01:57 2011
- native YouTube handler: support https URLs
- update youtube-dl compatibility to 2011.09.18c
- don't force MPlayer for https URIs

1.5.8 Thu Sep 22 20:06:17 2011
- compatibility with PMS >= 1.40.0
- fix scripts: gameswelt, giantbomb and pc_games
Expand Down
4 changes: 2 additions & 2 deletions misc/tools/generate_youtube_dl_regex_list.sh
@@ -1,7 +1,7 @@
#!/bin/sh

curl --silent https://github.com/rg3/youtube-dl/raw/master/youtube-dl \
curl --silent https://raw.github.com/rg3/youtube-dl/master/youtube-dl \
| ack "_VALID_URL\s*=\s*r('[^']+')" --output '$1' \
| perl -pe "chomp; s/\$/,\\n/; s{^'(?!\\^)}{'^}; s{\\\\}{\\\\\\\\}g" \
| perl -pe "chomp; s/\$/,\\n/; s{^'(?!\\^)}{'^}; s{\\\\}{\\\\\\\\}g; s{\?P<\w+>}{}g" \
| sort \
| perl -0777 -pe 's{,$}{}'
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.chocolatey.pmsencoder</groupId>
<artifactId>pmsencoder</artifactId>
<version>1.5.8</version>
<version>1.5.9</version>
<name>PMSEncoder</name>
<description>A plugin for PS3 Media Server that adds support for scriptable web video streaming.</description>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/com/chocolatey/pmsencoder/Plugin.groovy
Expand Up @@ -23,7 +23,7 @@ import no.geosoft.cc.io.FileMonitor
import org.apache.log4j.xml.DOMConfigurator

public class Plugin implements ExternalListener, FileListener {
private static final String VERSION = '1.5.8'
private static final String VERSION = '1.5.9'
private static final String DEFAULT_SCRIPT_DIRECTORY = 'pmsencoder'
private static final String LOG_CONFIG = 'pmsencoder.log.config'
private static final String SCRIPT_DIRECTORY = 'pmsencoder.script.directory'
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/scripts/mplayer.groovy
Expand Up @@ -9,6 +9,7 @@ end {
'file',
'gopher',
'http',
'https',
'pipe',
'rtmp',
'rtmpe',
Expand Down
20 changes: 14 additions & 6 deletions src/main/resources/scripts/youtube.groovy
Expand Up @@ -4,7 +4,7 @@ check {
profile ('YouTube Metadata') {
// extract the resource's video_id from the URI of the standard YouTube page
pattern {
match $URI: '^http://(?:\\w+\\.)?youtube\\.com/watch\\?v=(?<youtube_video_id>[^&]+)'
match $URI: '^https?://(?:\\w+\\.)?youtube\\.com/watch\\?v=(?<youtube_video_id>[^&]+)'
}

action {
Expand All @@ -27,22 +27,30 @@ check {
pattern {
// match any of the sites youtube-dl supports - copied from the source
match $URI: [
'^gvsearch(\\d+|all)?:[\\s\\S]+',
'^(?:http://)?(?:[a-z0-9]+\\.)?photobucket\\.com/.*[\\?\\&]current=(.*\\.flv)',
'^(?:http://)?(?:[a-z]+\\.)?video\\.yahoo\\.com/(?:watch|network)/([0-9]+)(?:/|\\?v=)([0-9]+)(?:[#\\?].*)?',
'^(?:https?://)?(?:\\w+\\.)?facebook.com/video/video.php\\?(?:.*?)v=(?P<ID>\\d+)(?:.*)',
'^((?:https?://)?(?:youtu\\.be/|(?:\\w+\\.)?youtube(?:-nocookie)?\\.com/)(?:(?:(?:v|embed)/)|(?:(?:watch(?:_popup)?(?:\\.php)?)?(?:\\?|#!?)(?:.+&)?v=)))?([0-9A-Za-z_-]+)(?(1).+)?$',
'^(?:https?://)?(?:\\w+\\.)?blip\\.tv(/.+)$',
'^(?:https?://)?(?:\\w+\\.)?facebook.com/video/video.php\\?(?:.*?)v=(\\d+)(?:.*)',
'^(https?://)?(www\\.)?escapistmagazine.com/videos/view/([^/]+)/([^/?]+)[/?]?.*$',
'^(?:https?://)?(?:(?:www|player).)?vimeo\\.com/(?:groups/[^/]+/)?(?:videos?/)?([0-9]+)',
'^((?:https?://)?(?:youtu\\.be/|(?:\\w+\\.)?youtube(?:-nocookie)?\\.com/)(?!view_play_list|my_playlists|artist|playlist)(?:(?:(?:v|embed|e)/)|(?:(?:watch(?:_popup)?(?:\\.php)?)?(?:\\?|#!?)(?:.+&)?v=))?)?([0-9A-Za-z_-]+)(?(1).+)?$',
'^(?:http://)?video\\.google\\.(?:com(?:\\.au)?|co\\.(?:uk|jp|kr|cr)|ca|de|es|fr|it|nl|pl)/videoplay\\?docid=([^\\&]+).*',
'^(?:http://)?(?:\\w+\\.)?depositfiles.com/(?:../(?#locale))?files/(.+)',
'^(?:http://)?(?:www\\.)?metacafe\\.com/watch/([^/]+)/([^/]+)/.*',
'^(?:http://)?(?:www\\.)?myvideo\\.de/watch/([0-9]+)/([^?/]+).*',
'^(?:(?:(?:http://)?(?:\\w+\\.)?youtube.com/user/)|ytuser:)([A-Za-z0-9_-]+)',
'^(?:http://)?(?:\\w+\\.)?youtube.com/(?:(?:view_play_list|my_playlists|artist)\\?.*?(p|a)=|user/.*?/user/|p/|user/.*?#[pg]/c/)([0-9A-Za-z]+)(?:/.*?/([0-9A-Za-z_-]+))?.*',
'^(?i)(?:https?://)?(?:www\\.)?dailymotion\\.[a-z]{2,3}/video/([^_/]+)_([^/]+)'
'^(?:http://)?(?:\\w+\\.)?youtube.com/(?:(?:view_play_list|my_playlists|artist|playlist)\\?.*?(p|a|list)=|user/.*?/user/|p/|user/.*?#[pg]/c/)([0-9A-Za-z]+)(?:/.*?/([0-9A-Za-z_-]+))?.*',
'^(?i)(?:https?://)?(?:www\\.)?dailymotion\\.[a-z]{2,3}/video/([^_/]+)_([^/]+)',
'^(:(tds|thedailyshow|cr|colbert|colbertnation|colbertreport))|(https?://)?(www\\.)?(thedailyshow|colbertnation)\\.com/full-episodes/(.*)$',
'^ytsearch(\\d+|all)?:[\\s\\S]+',
'^yvsearch(\\d+|all)?:[\\s\\S]+'
]
}

action {
// XXX: keep this up-to-date
$youtube_dl_compatible = '2011.02.25c' // version the regexes were copied from
$youtube_dl_compatible = '2011.09.18c' // version the regexes were copied from
}
}

Expand Down

0 comments on commit 3cfc621

Please sign in to comment.