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
Home Country
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,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    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
    Home Country
    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
    Home Country
    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
    Home Country
    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,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    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
    Home Country
    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

    Top Bottom