quodlibet / quodlibet

Music player and music library manager for Linux, Windows, and macOS
https://quodlibet.readthedocs.io
GNU General Public License v2.0
1.43k stars 224 forks source link

Send to iPod/iPad/iPhone wirelessly Plugin #605

Open lazka opened 9 years ago

lazka commented 9 years ago

Original issue 605 created by nowayx on 2010-11-06T07:44:20.000Z:

This plugin allows you to send your music to your iPod/iPad/iPhone wirelessly (using ssh).

You MUST have a jailbroken iPod/iPad/iPhone with OpenSSH installed (you can install OpenSSH from Cynndia).

Configure the mobile account and add the key from your computer to it. By doing that your computer will be able to connect to your device using the mobile account without asking you for a password. Instructions here: http://www.hostingrails.com/HowTo-SSH-SCP-without-a-password

After sending your music to your device, don't forget to enable 'Need Sync' on your PwnTunes settings (install this App as well from Cyndia).

Initial version...

lazka commented 9 years ago

Comment #1 originally posted by reiter.christoph on 2010-11-06T09:39:31.000Z:

<empty>

CreamyCookie commented 5 years ago

The code from the archived page:

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation

import os, gtk, util, qltk, config
from plugins.songsmenu import SongsMenuPlugin

class SendToiPod(SongsMenuPlugin):
    PLUGIN_ID = "send_to_ipod_w"
    PLUGIN_NAME = _("Send to iPod Wirelessly")
    PLUGIN_DESC = _("Upload songs to an iPod Wirelessly (needs a jailbroken iPhone/iPod/iPad).\n\n"
                "You must have OpenSSH installed on your iPod and have the account 'mobile'\n"
            "configured to accept connections from your computer without a prompting\n"
            "for a password (Google ssh-keygen to learn how to do this.)\n\n"
            "This plugin will copy the files to '/private/var/mobile/Media/My Music'\n"
            "after sending files to your iPod, make sure you set PwnTunes to 'Needs Syc'.")
    PLUGIN_VERSION = "0.1"
    PLUGIN_ICON = gtk.STOCK_CONVERT

    try: config.get("plugins", 'send_to_ipod_w_ip')
    except: config.set("plugins", 'send_to_ipod_w_ip', "192.168.0.1")

    def PluginPreferences(klass, parent):
        hb = gtk.HBox(spacing=3)
        hb.set_border_width(6)
        e = gtk.Entry(16)
        e.set_width_chars(16)
        e.set_text(config.get('plugins', 'send_to_ipod_w_ip'))
        e.connect('changed', lambda e: config.set('plugins', 'send_to_ipod_w_ip', e.get_text()))
        hb.pack_start(gtk.Label("IP Address"), expand=False)
        hb.pack_start(e, expand=False)
        hb.show_all()
        return hb
    PluginPreferences = classmethod(PluginPreferences)

    def plugin_songs(self, songs):

        for i, song in enumerate(songs):
            if self.__upload(song):
                return True

    def __upload(self, song):
        filename = song["~filename"]

    if os.system("scp %r \"mobile@%s:/private/var/mobile/Media/My\ Music/\"" % (filename, config.get("plugins", 'send_to_ipod_w_ip'))):
            qltk.ErrorMessage(
                    None, "Error uploading",
                    "Unable to upload <b>%s</b>. iPod may be "
                    "out of space, turned off, or it has a new IP address."%(
                    util.escape(filename))).run()
            return True

Maybe it would be possibly to merge something like this into the "sync to device" plugin (#2636), but not sure how common the use case here is.