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

Discussion in 'OnlineVideos' started by DreadFury, December 24, 2009.

Thread Status:
Not open for further replies.
  1. DreadFury

    DreadFury Portal Pro

    Joined:
    June 28, 2009
    Messages:
    252
    Likes Received:
    14
    Ratings:
    +14 / 0
    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.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. offbyone
    • Team MediaPortal

    offbyone Development Group

    Joined:
    April 26, 2008
    Messages:
    3,981
    Likes Received:
    2,704
    Gender:
    Male
    Location:
    Stuttgart
    Ratings:
    +3,303 / 3
    Home Country:
    Germany Germany
    Show System Specs
    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.
     
  4. DreadFury

    DreadFury Portal Pro

    Joined:
    June 28, 2009
    Messages:
    252
    Likes Received:
    14
    Ratings:
    +14 / 0
    Home Country:
    United States of America United States of America

    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. =)
     
  5. DreadFury

    DreadFury Portal Pro

    Joined:
    June 28, 2009
    Messages:
    252
    Likes Received:
    14
    Ratings:
    +14 / 0
    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.
     
  6. Sabbe

    Sabbe Portal Pro

    Joined:
    January 7, 2007
    Messages:
    56
    Likes Received:
    2
    Location:
    Västerås
    Ratings:
    +2 / 0
    Home Country:
    Sweden Sweden
    I am not familiar with the code used (only knows PHP) but it seems like something goes wrong here:

    Code (Text):
    1.  
    2. public override String getUrl(VideoInfo foVideo)
    3.         {
    4.             Dictionary<string, string> Items = new Dictionary<string, string>();
    5.             GetVideInfo(foVideo.VideoUrl, Items);
    6.  
    7.             string Token = "";
    8.             string FmtMap = "";
    9.  
    10.             if (Items.ContainsKey("token"))
    11.                 Token = Items["token"];
    12.             if (Token == "" && Items.ContainsKey("t"))
    13.                 Token = Items["t"];
    14.             if (Items.ContainsKey("fmt_map"))
    15.                 FmtMap = System.Web.HttpUtility.UrlDecode(Items["fmt_map"]);
    16.  
    17.  
    18.             if (videoQuality == VideoQuality.HD && !FmtMap.Contains("22/"))
    19.             {
    20.                 videoQuality = VideoQuality.High;
    21.             }
    22.  
    23.             string lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&ext=.flv", foVideo.VideoUrl, Token);
    24.             switch (videoQuality)
    25.             {
    26.                 case VideoQuality.Normal:
    27.                     lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&ext=.flv", foVideo.VideoUrl, Token);
    28.                     break;
    29.                 case VideoQuality.High:
    30.                     lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&fmt=18&ext=.mp4", foVideo.VideoUrl, Token);
    31.                     break;
    32.                 case VideoQuality.HD:
    33.                     lsUrl = string.Format("http://youtube.com/get_video?video_id={0}&t={1}&fmt=22&ext=.mp4", foVideo.VideoUrl, Token);
    34.                     break;
    35.             }
    36.             Log.Info("youtube video url={0}", lsUrl);
    37.             return lsUrl;
    38.         }
    39.        
    40.  
     
  7. offbyone
    • Team MediaPortal

    offbyone Development Group

    Joined:
    April 26, 2008
    Messages:
    3,981
    Likes Received:
    2,704
    Gender:
    Male
    Location:
    Stuttgart
    Ratings:
    +3,303 / 3
    Home Country:
    Germany Germany
    Show System Specs
    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.
     
    • Like Like x 1
  8. DreadFury

    DreadFury Portal Pro

    Joined:
    June 28, 2009
    Messages:
    252
    Likes Received:
    14
    Ratings:
    +14 / 0
    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! ^^
     
  9. DreadFury

    DreadFury Portal Pro

    Joined:
    June 28, 2009
    Messages:
    252
    Likes Received:
    14
    Ratings:
    +14 / 0
    Home Country:
    United States of America United States of America
Loading...
Thread Status:
Not open for further replies.

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!