Ignore:
Timestamp:
Mar 23, 2014, 11:07:01 PM (12 years ago)
Author:
Stephan
Message:

[xupnpd] fixed youtube and vimeo plugins

Location:
ipk/source.sh4/network_xupnpd/_path_/etc/xupnpd/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ipk/source.sh4/network_xupnpd/_path_/etc/xupnpd/plugins/xupnpd_vimeo.lua

    r27875 r27895  
    44
    55cfg.vimeo_video_count=100
     6cfg.vimeo_fmt='hd'
    67
    78function vimeo_parse_feed(feed_url)
     
    9394    local vimeo_id=string.match(vimeo_url,'.+/(%w+)$')
    9495
    95     local clip_page=plugin_download(vimeo_url)
     96    local config=plugin_download('http://player.vimeo.com/v2/video/'..vimeo_id..'/config')
    9697
    97     if clip_page then
    98         local ts,sig=string.match(clip_page,'"timestamp":(%w+),"signature":"(%w+)",')
    99         clip_page=nil
     98    if config then
     99        local x=json.decode(config)
    100100
    101         if sig and ts then
    102             url=string.format('http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=hd&codecs=H264&type=moogaloop_local&embed_location=',vimeo_id,sig,ts)
     101        config=nil
     102
     103        if x and x.request and x.request.files and x.request.files.h264 then
     104            if cfg.vimeo_fmt=='sd' then
     105                url=x.request.files.h264.sd
     106            else
     107                url=x.request.files.h264.hd or x.request.files.h264.sd
     108            end
    103109        end
    104110    end
    105111
    106     return url
     112    if url then return url.url end
     113
     114    return nil
    107115
    108116end
     
    117125plugins.vimeo.ui_config_vars=
    118126{
    119     { "input",  "vimeo_video_count", "int" }
     127    { "input",  "vimeo_video_count", "int" },
     128    { "select", "vimeo_fmt" }
    120129}
  • ipk/source.sh4/network_xupnpd/_path_/etc/xupnpd/plugins/xupnpd_youtube.lua

    r27875 r27895  
    229229                end
    230230
    231                 urls[tonumber(item['itag'])]=item['url']..'&signature='..(item['sig'] or item['s'])
     231                local sig=item['sig'] or item['s']
     232                local u=item['url']
     233                if sig then u=u..'&signature='..sig end
     234                --print(item['itag'],u)
     235                urls[tonumber(item['itag'])]=u
    232236
    233237                --print('\n')
Note: See TracChangeset for help on using the changeset viewer.