Some videos don't work on youtube (NOT CODEC - Plugin bug?) (1 Viewer)

Status
Not open for further replies.

DreadFury

Portal Pro
June 28, 2009
252
14
United States of America United States of America
I have seen a lot of posts about some videos not working on youtube.
I too have had this problem and it is not a codec problem.

After much investigation, i have finally found the cause of the broken videos.


Some videos at random (I am not sure what triggers the bug) are missing a part if the link, the 't' variable.

Let's use Scatman John's video 'Scatman' as an example.
(In the plugin's search, you can enter 'Scatman' and get this video from the first result.

This video is located here: http://www.youtube.com/watch?v=mpHLEm9-0bg

The link fed into the player SHOULD be: http://youtube.com/get_video?video_...cFN8KspMtieHgk5HfP2kB7ZmLLUt3rchdyA=&ext=.***

however, the link being fed is: http://youtube.com/get_video?video_id=mpHLEm9-0bg&t=&ext=.***

Notice how the 't' variable is blank in the link?

Also, shouldn't the 'ext' variable be replaced with the 'fmt' variable?


This happens on random videos through favorites, feeds, AND search.
I have tried all setting in the config for quality.


Could a dev look into this please? it is breaking the true value of the youtube portion of this plugin, and I am sure it is an easy fix.

I am running the latest plugin, latest MP SVN, and am on Vista ultimate x64.
All other videos work fine.
 

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,981
    3,703
    Stuttgart
    Germany Germany
    Country flag
    I'll try to debug that issue.
    Not sure why this happens -> The plugin is using the official Google YouTube API to access the urls.
     

    DreadFury

    Portal Pro
    June 28, 2009
    252
    14
    United States of America United States of America
    I'll try to debug that issue.
    Not sure why this happens -> The plugin is using the official Google YouTube API to access the urls.

    I'm not sure either, it took me forever to figure it out because I kept assuming it was a codec error.
    Once I really delved deep into the log files tho, I found the problem videos had missing info in the urls.


    I hope you find the problem, it would be so awesome if all videos worked. =)
     

    DreadFury

    Portal Pro
    June 28, 2009
    252
    14
    United States of America United States of America
    Also, the thumbnails for these 'problem videos' work fine, so the proper url is being used to find the thumbs.

    Not sure if this helps, but I thought I would add it.
     

    Sabbe

    Portal Pro
    January 7, 2007
    56
    2
    Västerås
    Sweden Sweden
    I am not familiar with the code used (only knows PHP) but it seems like something goes wrong here:

    Code:
    public override String getUrl(VideoInfo foVideo)
            {
                Dictionary<string, string> Items = new Dictionary<string, string>();
                GetVideInfo(foVideo.VideoUrl, Items);
    
                string Token = "";
                string FmtMap = "";
    
                if (Items.ContainsKey("token"))
                    Token = Items["token"];
                if (Token == "" && Items.ContainsKey("t"))
                    Token = Items["t"];
                if (Items.ContainsKey("fmt_map"))
                    FmtMap = System.Web.HttpUtility.UrlDecode(Items["fmt_map"]);
    
    
                if (videoQuality == VideoQuality.HD && !FmtMap.Contains("22/"))
                {
                    videoQuality = VideoQuality.High;
                }
    
                string lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&ext=.flv", foVideo.VideoUrl, Token);
                switch (videoQuality)
                {
                    case VideoQuality.Normal:
                        lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&ext=.flv", foVideo.VideoUrl, Token);
                        break;
                    case VideoQuality.High:
                        lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&fmt=18&ext=.mp4", foVideo.VideoUrl, Token);
                        break;
                    case VideoQuality.HD:
                        lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&fmt=22&ext=.mp4", foVideo.VideoUrl, Token);
                        break;
                }
                Log.Info("youtube video url={0}", lsUrl);
                return lsUrl;
            }
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,981
    3,703
    Stuttgart
    Germany Germany
    Country flag
    I (hopefully) fixed the YouTube problem yesterday. So please test it when OnlineVideos 0.16 will be available.

    The problem is that youtube has some qualities for each clip, but not every quality for all the clips. So the fmt 18 and 22 are not there for every clip. I recoded it, so that there is a check which qualities are available and which best matches the one configured in OnlineVideos YouTube Settings.
     

    DreadFury

    Portal Pro
    June 28, 2009
    252
    14
    United States of America United States of America
    I will test it as soon as I am able (Even willing to beta test it if you wish.

    Thanks offbyone, you always come through for us! ^^
     
    Status
    Not open for further replies.

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    N [not reproducible] Online videos not working at all Submit: Bug Reports 1
    R Bug: Video Folders disappear General Support 11
    Stephen O'Kane [SOLVED] TV Stream stuttering - both Video and Audio Watch / Listen Media 14
    B some music videos stutter Watch / Listen Media 0
    I 1.25.0 Videos in HEVC UHD 2160p don't play good watch/edit Videos 8
    CanadianEh MP TV server rebuild with Colossus 2 - Kodi clients receive PMT error when playing videos recoreded by Colossus 2 TV-Server 1
    Rob Hexenmeister Skinning Online Videos question OnlineVideos 2
    A [solved] How to Play All Videos in a List watch/edit Videos 3
    O 1.25.0 Codecs and Video Format for PlayStation 2 Codecs, External Players 0
    g0rsq Info box randomly popping up when watching TV or other video MediaPortal 2 Newcomers Forum 1
    I Video Playback Stuttering General Support 45
    B some videos jerky Television (MyTV frontend and TV-Server) 0
    B MP 2.2.3 Error playing videos from NAS Submit: Bug Reports 2
    T Kurze Tonaussetzter bei Videos und TV Allgemeines Supportforum 1
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    ajs [Proposal] Video embedded cover MediaPortal 1 1
    G [solved] Black Screen on all videos after upgrading to either 1.23 or 1.24 from 1.22 General Support 4
    H random black screen live tv and videos (amended) General Support 0
    404 [solved] Live TV...video and audio freeze General Support 20
    R kein Ton bei TV, Video, Aufnahme, Musik Allgemeines Support- und Diskussionsforum 0
    U [solved] Dynamic Refresh Rate for 23fps video Watch / Listen Media 1
    J Debug OnlineVideos, How To? OnlineVideos 1
    A MP2.2.2, understanding movies/videos/tv and WTV recordings. General 16
    C Problem playing videos created on IPhone X and Samsung S9 General Support 2
    H [solved] Video database genres, sort titles and collection thumbnails Newcomers Forum 12
    Similar threads

























    Top Bottom