Miro, YouTube and Vevo

THIS POST IS OUTDATED, it’s pretty much useless. If you don’t want to change the Code of Miro by yourself, you can ignore this post!

Miro is a great piece of Open Source Software which is a media player,  podcast downloader (via RSS), BitTorrent client, music library and streaming server at once.  Here is a screenshot, if you want to know more about it, head over to http://www.getmiro.com :

Miro

I use it to watch some Podcasts and to automatically download my Youtube-Favourites. But when it comes to Youtube and „restricted-videos“, Miro won’t download it. And that are not just some musicvideos, no, basically every video which cannot be embedded on other sites an a lots of videos which have just some copyright protected background music in it. I’m sure that many of the users of Miro have already recognized that behavior.
There is no error-message, just when you are looking into the logs, you can find something like that:

WARNING root: youtube download failed because: This video contains content from Vevo. It is restricted from playback on certain sites.<br/><u><a href=’http://www.youtube.com/watch?v=[some-id]&feature=player_embedded‘ target=’_blank‘>Watch on YouTube</a></u>

And to be clear, thats not a bug, its a wanted behavior. Miro isn’t about enabling everyone to bypass copyright restrictions.

But its disturbing as hell…. and senseless…. cause if you have some video which cannot be downloaded, just find a copy of it and try that, and in most cases there IS some copy of the video which you can download.
So i decided to change that behavior of Miro and to allow it to download restricted content as well.  And if its able to get it, it will download the best version with the highest resolution of it.

It took some time, but here’s the code (just works with miro-4.0.5):
Patches:    downloader-youtubedl.patch    httpclient-youtubedl.patch   flashscraper-youtubedl.patch
Ebuild for Gentoo: miro-4.0.5.ebuild

How to install it:

  • For Gentoo:
    •  Create Directory /usr/local/portage/media-video/miro and /usr/local/portaeg/media-video/miro/files
    •  Copy the 3 Patches to   /usr/local/portaeg/media-video/miro/files and the ebuild to /usr/local/portage/media-video/miro
    •  run ebuild miro-4.0.5.ebuild digest in  /usr/local/portage/media-video/miro
    •  add „media-video/miro youtubedl“ to /etc/portage/packages.use
    •  emerge -av miro
  • For every other Linux-Distro:
    • Install Miro-4.0.5 and youtube-dl
    • Locate the directory where the miro-files are stored, and cd to that location:
       unregistr3d@gentoo-SN1 ~ % locate miro | grep flashscraper.py
      /usr/lib64/python2.7/site-packages/miro/flashscraper.py
      /usr/lib64/python2.7/site-packages/miro/flashscraper.pyo
      nregistr3d@gentoo-SN1 ~ % cd /usr/lib64/python2.7/site-packages/miro/
      
    • Get root, download the patches and apply them:
       unregistr3d@gentoo-SN1 /usr/lib64/python2.7/site-packages/miro % su root
      root@gentoo-SN1# wget http://dl.dropbox.com/u/27922767/downloader-youtubedl.patch
      root@gentoo-SN1# wget http://dl.dropbox.com/u/27922767/httpclient-youtubedl.patch
      root@gentoo-SN1# wget http://dl.dropbox.com/u/27922767/flashscraper-youtubedl.patch
      root@gentoo-SN1# patch flashscraper.py -i flashscraper-youtubedl.patch
      root@gentoo-SN1# patch httpdownloader.py -i httpdownloader-youtubedl.patch
      root@gentoo-SN1# patch downloader.py -i downloader-youtubedl.patch 

Thats it!  Start Miro and try it 🙂
If you have any problems, just leave a comment.

PS: Miro gives strange filenames to the videos, i will fix that later.