GitXplorerGitXplorer
d

YouTube-iTunes-Sync

public
6 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
7497da388b19c87a75594e0079bafaa092f59956

Mark as unmaintained. Provide alternatives.

ddavidfstr committed 12 years ago
Unverified
a5918cb29015c096c228227ef7d33f63ae1546f6

Tweak README introduction.

ddavidfstr committed 12 years ago
Unverified
95bfe953e8b7dd8c7d26d2b02a2b787beeabebfd

Add README and LICENSE.

ddavidfstr committed 12 years ago
Unverified
a03c65194e9a0f3871889d38e92382c538c43d69

Improve compatibility with Python 2.6.

ddavidfstr committed 12 years ago
Unverified
c90237ef0803fe37e3999048166d0e6e3cb4c3d2

Exclude 'contrib' from repository.

ddavidfstr committed 12 years ago
Unverified
afa62b13400b933e5235d088b25240ed8a3c26b1

Sync YouTube playlist to iTunes.

ddavidfstr committed 12 years ago

README

The README file for this repository.

YouTube-iTunes Sync 1.0

Synchronizes a YouTube music playlist with iTunes. Once synchronized with iTunes they become available on your iPhone and other Apple devices.

This is useful if you have a YouTube playlist full of music or music videos and want to be able to play them anywhere.

NOTE: This project is no longer being maintained. It is recommended that playlists be downloaded manually with youtube-dl. Then syncing with iTunes is sufficiently easy to do by hand.

Requirements

  • Mac OS X 10.7+ (Lion)
    • 10.6 (Snow Leopard) probably works too, but I have not tested this.
  • iTunes 10+
    • Probably any iTunes version works, but this is the one I have tested.
  • Python 2.6
    • This is included with the above Mac OS X version.

And additionally:

  • youtube_dl installed in your PYTHONPATH.
    • You will need to download a source package from the youtube-dl Github page. The binary version on the main youtube-dl website is not sufficient
    • The 2012.11.29 version is recommend, since it has been tested.
  • ffmpeg and ffprobe commands installed in your system PATH
    • You will probably need to compile ffmpeg to get ffprobe, since it is typically not included in binary distributions of ffmpeg.

Usage

./sync_youtube_to_itunes.py <YouTube-Playlist-URL> <Directory-Path> <iTunes-Playlist-Name>

For example:

./sync_youtube_to_itunes.py http://www.youtube.com/playlist?list=PL5F93ED354981399F /Users/davidf/Music/YT-Music YT-Music

Multi-Step

Or, if you would like to perform the synchronization in two steps for some reason:

./sync_youtube_to_filesystem.py <YouTube-Playlist-URL> <Directory-Path>

./sync_filesystem_to_itunes.py <Directory-Path> <iTunes-Playlist-Name>

Special Features

  • Handles [Video Deleted] items in YouTube playlists
  • Unicode support (for playlist item titles and similar)

Design

Here's how the script works:

  • YouTube playlists are downloaded to the local filesystem using the excellent youtube_dl library. An invisible .ordering file tracks the original order of downloaded items.
    • The youtube-dl library is maintained independently by the community and is regularly updated when YouTube changes their unofficial APIs.
  • Downloaded videos are converted to the MP4 (AAC) format that iTunes expects using ffmpeg.
  • iTunes playlists are manipulated using the actual iTunes application via Apple Events sent by the osascript tool (available only on Mac OS X).
    • This is much safer than the alternative approach of editing the existing the iTunes Library XML file directly.

Wishlist

Some improvements I would like to make:

  • Better error handling.
    • Complain if ffmpeg & ffprobe are not installed.
    • Compiain if the specified filesystem directory does not exist.
  • Simplify installation by providing a binary distribution.
    • It is cumbersome to require users to install youtube_dl, ffmpeg, and ffprobe manually.
  • Improve marketing by creating a custom website (likely via GitHub Pages).
  • ☆ Sync the YouTube thumbnail to iTunes as album art.
  • Support syncing full videos from YouTube playlists to iTunes (in addition to the audio track).
    • For videos unavailable in an iTunes-friendly format (i.e. MP4/M4V), ffmpeg or HandBrakeCLI could be used to transcode videos.
  • ☆ Download video metadata (ex: title, description, etc) for archival purposes.
  • ☆ If a video becomes [Video Deleted] on YouTube, preserve the downloaded version of the video (if available).
  • Improved support for Python 2.6.

Starred items (☆) are my personal most-wanted improvements.

License

This software is freeware. For details, see the LICENSE file.