「Spotify」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(ページの作成:「Category:音声/動画 Category:Wine en:Spotify [http://www.spotify.com/ Spotify] は数百万もの曲にアクセスすることができるデジタル音...」)
 
20行目: 20行目:
 
[[Wine]] を見て下さい。
 
[[Wine]] を見て下さい。
   
  +
Spotify のウェブサイトでアカウント登録してから Spotify を取得してください。アプリケーションのアプリ内登録はできません。ただし次の URL を使うことで登録をする前にアプリケーションを取得することは可能です: [http://download.spotify.com/Spotify%20Installer.exe]。
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration. However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]
 
   
 
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.
 
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.
40行目: 40行目:
 
== グローバルなメディアホットキー ==
 
== グローバルなメディアホットキー ==
   
  +
Spotify は {{ic|XF86AudioPlay}} などのメディアキーをサポートしています。ただし何も設定をしていなかった場合 Spotify の中でしか動作しません。[[xbindkeys]] などを使用してグローバルのメディアキーの押下を取得してから、以下のどれか方法を使うことで Spotify に転送することができます。
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.
 
   
 
=== Linux ===
 
=== Linux ===
56行目: 56行目:
 
==== xdotool ====
 
==== xdotool ====
   
  +
{{ic|xdotool}} を使うことでホットキーをアプリケーションに送信することが可能です。以下は Spotify を外側から操作するスクリプトの例です:
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:
 
   
 
#!/bin/sh
 
#!/bin/sh
78行目: 78行目:
 
exit 0
 
exit 0
   
  +
{{ic|musickeys.sh}} のように名前をつけて、スクリプトに実行可能属性を付与してください:
Let us call it {{ic|musickeys.sh}}. Make the script executable:
 
   
 
$ chmod +x musickeys.sh
 
$ chmod +x musickeys.sh
126行目: 126行目:
 
===Windows ===
 
===Windows ===
   
If you prefer the wine-version of Spotify, you can use {{AUR|spotifycmd}} to send actions to Spotify. [https://github.com/Tarrasch/dotfiles/compare/0149505f%5E...19ede1f6 Here] is a sample setup of xmonad bindings using spotifycmd.
+
wine 版の Spotify を使っている場合、{{AUR|spotifycmd}} を使用して Spotify にアクションを送信することができます。[https://github.com/Tarrasch/dotfiles/compare/0149505f%5E...19ede1f6 こちら] spotifycmd を使用した xmonad バインディングの設定例があります。
   
 
== Tips & Tricks ==
 
== Tips & Tricks ==
142行目: 142行目:
 
=== トラック通知を表示 ===
 
=== トラック通知を表示 ===
   
  +
{{AUR|playerctl}} には {{pkg|python-gobject}} と {{pkg|dunst}} のような通知デーモンと一緒に使用するライブラリが付属しており、トラックが変更されたときにアーティストとタイトルを通知で表示することができます。
{{AUR|playerctl}} provides a library you can use with {{pkg|python-gobject}} and a notification daemon such as {{pkg|dunst}} to show the artist and title in a notification when the track changes.
 
   
 
#!/usr/bin/env python3
 
#!/usr/bin/env python3
265行目: 265行目:
 
This will tell dwm to start spotify as a floating window associated with the tag "2" no matter what window mode you are in. Recompile and install dwm to apply your new settings.
 
This will tell dwm to start spotify as a floating window associated with the tag "2" no matter what window mode you are in. Recompile and install dwm to apply your new settings.
   
=== ラジオが動作しない ===
+
=== 検索やブラウザ、ラジオが動作しない ===
   
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales
+
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning non-english locales
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.
+
If various tabs like browsing only show a blank screen, the search field doesn't seem to do anything or the radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale.
  +
  +
Spotify を起動する前に {{ic|LC_NUMERIC}} 環境変数を {{ic|en_US.utf8}} に設定してみてください。
   
 
=== Spotify がローカルファイルを再生しない ===
 
=== Spotify がローカルファイルを再生しない ===
278行目: 280行目:
 
=== SpotifyHelper.exe がクラッシュする (Windows クライアント) ===
 
=== SpotifyHelper.exe がクラッシュする (Windows クライアント) ===
   
  +
Spotify を起動した時に SpotifyHelper.exe がクラッシュする場合、{{ic|winecfg}} で d3d9 ライブラリを無効化してください。"Libraries" タブを開いて、"d3d9" を選んで Add をクリックしてください。無効化するには、edit をクリックして "Disable" オプションを選択してください。
If SpotifyHelper.exe crashes when starting Spotify, disable the d3d9 library with {{ic|winecfg}}. Go to the "Libraries" tab, choose "d3d9" and click Add. To disable it, click edit and select the "Disable" option.
 
   
 
=== ランチャーアイコンがおかしい (Windows クライアント) ===
 
=== ランチャーアイコンがおかしい (Windows クライアント) ===
   
If the Spotify icon does not show up correctly in your launcher, add the following line to {{ic|~/.local/share/applications/wine/Programs/Spotify.desktop}}:
+
ランチャーに Spotify アイコンが正しく表示されない場合、次の行を {{ic|~/.local/share/applications/wine/Programs/Spotify.desktop}} に追加してください:
   
 
StartupWMClass=spotify.exe
 
StartupWMClass=spotify.exe
292行目: 294行目:
 
=== プロキシを使ったときにアルバム画像が表示されない、四角が表示される ===
 
=== プロキシを使ったときにアルバム画像が表示されない、四角が表示される ===
   
Quit spotify, then open spotify preferences {{ic|~/.config/spotify/prefs}}
+
spotify を終了して、spotify の設定 {{ic|~/.config/spotify/prefs}} を開いて下さい。
 
 
Change @https to @http:
+
@https @http に変更してください:
   
 
network.proxy.addr="your-proxy.com:80<strong>@http</strong>"
 
network.proxy.addr="your-proxy.com:80<strong>@http</strong>"
303行目: 305行目:
 
=== Spotify でローカルネットワーク上の他のデバイスが検出されない ===
 
=== Spotify でローカルネットワーク上の他のデバイスが検出されない ===
   
  +
ファイアウォールを使っている場合、UDP と TCP のポート 57621 を開いて下さい。[[iptables]] の[[シンプルなステートフルファイアウォール]]を使用している場合、以下で設定できます:
If a firewall is in place, open ports 57621 for UDP and TCP. If you use a variant of the [[iptables]] [[Simple stateful firewall]], the following should do it:
 
   
 
iptables -A TCP -p tcp --dport 57621 -j ACCEPT -m comment --comment spotify
 
iptables -A TCP -p tcp --dport 57621 -j ACCEPT -m comment --comment spotify

2015年4月6日 (月) 19:25時点における版

Spotify は数百万もの曲にアクセスすることができるデジタル音楽サービスです。

このインターネット音楽サービスを使うことで無料でデータベースから曲を選択してストリーミング再生できます。以前はヨーロッパ限定でしたが、最近になってアメリカでもサービスが開始されました。Debian と Fedora ディストリビューション向けに公式に Linux クライアントがパッケージで配布されており、AUR からインストールすることが可能です: spotifyAUR。公式では、Linux ユーザーは Wine で Windows クライアントを動かすことを推奨しています。また、曲の間にときどき音声広告が流れます。

Spotify では無料ユーザーがプレイリストを作成することができ、シャッフルしたり、リピートするトラックを設定することができます。Spotify で提供されているコンテンツにはオリジナル版と検閲版の両方があります。

クライアントのインストール

使用したいクライアントをどちらか選択してください。Linux クライアントの方が好評ですが、wine の使用に慣れている場合、windows クライアントを選択するのも良いでしょう。両方のクライアントをインストールする必要はありません。mopidyAUR + mopidy-spotifyAUR または despotify-svnAUR のようなオープンソースクライアントも存在しますが、基本的にプレミアムアカウントでないと動作しません。https://play.spotify.com/ で使えるオンラインプレイヤーも存在します (flash が必要です)。

Linux

AURspotifyAUR を使うと自動的にソフトウェアがダウンロードされます。ローカルファイルを再生したい場合は ffmpeg-compat もインストールする必要があります。

Windows (Wine)

Wine を見て下さい。

Spotify のウェブサイトでアカウント登録してから Spotify を取得してください。アプリケーションのアプリ内登録はできません。ただし次の URL を使うことで登録をする前にアプリケーションを取得することは可能です: [1]

After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.

$ wine Spotify\ Installer.exe

Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:

If you use a x86_64 copy of ArchLinux, you will have to run it like this:

$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"

If you use a x86 copy of ArchLinux, you can use this command just fine:

$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe

If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.

グローバルなメディアホットキー

Spotify は XF86AudioPlay などのメディアキーをサポートしています。ただし何も設定をしていなかった場合 Spotify の中でしか動作しません。xbindkeys などを使用してグローバルのメディアキーの押下を取得してから、以下のどれか方法を使うことで Spotify に転送することができます。

Linux

Playerctl

playerctlAUR ユーティリティは Spotify プロセスにコマンドを送信するコマンドラインツールを提供します。グローバルに設定する必要があるコマンドは play-pause, next, previous だけです:

$ playerctl play-pause
$ playerctl next
$ playerctl previous

Playerctl は始めに見つけたプレイヤーにコマンドを送るため、VLC などの他のプレイヤーでも使えます。他のプレイヤーを無視させるには、--player=spotify を引数に付けてください。

xdotool

xdotool を使うことでホットキーをアプリケーションに送信することが可能です。以下は Spotify を外側から操作するスクリプトの例です:

#!/bin/sh

case $1 in
   "play")
       key="XF86AudioPlay"
       ;;
   "next")
       key="XF86AudioNext"
       ;;
   "prev")
       key="XF86AudioPrev"
       ;;
   *)
       echo "Usage: $0 play|next|prev"
       exit 1
        ;;
esac
xdotool key --window $(xdotool search --name "Spotify (Premium |Unlimited |Free )?- Linux Preview"|head -n1) $key
exit 0

musickeys.sh のように名前をつけて、スクリプトに実行可能属性を付与してください:

$ chmod +x musickeys.sh

By executing ./musickeys.sh play you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as xbindkeys.

D-Bus

An alternative to the above is D-Bus, which should be available by default as it is a dependency of systemd. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.

To play or pause the current song in Spotify:

$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

In order to bind this and the other commands to the media keys you need to install Xbindkeys and edit your .xbindkeysrc and add the following lines:

# Play/Pause
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
XF86AudioPlay

# Next
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"
XF86AudioNext

# Previous
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"
XF86AudioPrev

# Stop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"
XF86AudioStop

If the above commands do not work, try setting the dbus address:

 USER=`whoami`
 PROCESS=spotify
 PID=`pgrep -o -u $USER $PROCESS`
 ENVIRON=/proc/$PID/environ
 if [ -e $ENVIRON ]
 then
     export `grep -z DBUS_SESSION_BUS_ADDRESS $ENVIRON`
 else
     echo "Unable to set DBUS_SESSION_BUS_ADDRESS."
     exit 1
 fi

Windows

wine 版の Spotify を使っている場合、spotifycmdAUR を使用して Spotify にアクションを送信することができます。こちら に spotifycmd を使用した xmonad バインディングの設定例があります。

Tips & Tricks

トラック通知を無効化

ノート: It is worth noting that if you have a SpotCommanderAUR Server running alongside Spotify, and you disable track notifications by following the instructions below, the SpotCommander Client running on your mobile device will display that “No Music is Playing” and will fail to display track info such as title, artist, album art, etc. Apart from that, the mobile client still works fine though, and is still able to skip, play, pause, control volume, etc.

バージョン 0.9.10 から、トラック変更の通知がデフォルトで有効になっています。この通知は非常に邪魔に思えるかもしれません。無効にするには、以下の行を ~/.config/spotify/Users/<spotifylogin>-user/prefs に追加してください:

 ui.track_notifications_enabled=false

--ui.track_notifications_enabled=false オプションを付けて spotify を実行することでも設定できます。

トラック通知を表示

playerctlAUR には python-gobjectdunst のような通知デーモンと一緒に使用するライブラリが付属しており、トラックが変更されたときにアーティストとタイトルを通知で表示することができます。

#!/usr/bin/env python3

from gi.repository import Playerctl, GLib
from subprocess import Popen

player = Playerctl.Player()

def on_track_change(player, e):
    track_info = '{artist} - {title}'.format(artist=player.get_artist(), title=player.get_title())
    Popen(['notify-send', track_info])

player.on('metadata', on_track_change)

GLib.MainLoop().run()

何度も再生されるラジオトラックをスキップ

playerctlAUR ライブラリの他の使い道としてラジオで何度も再生されるトラックをスキップすることができます。ラジオ局で聞きたくない曲を低く評価する必要はもうありません。

#!/usr/bin/env python3

from gi.repository import Playerctl, GLib

player = Playerctl.Player()

played_out = ['Zu Fuss', 'Walk And Talk', 'Neuland']

def on_track_change(player, e):
    if player.get_title() in played_out:
        player.next()

player.on('metadata', on_track_change)

GLib.MainLoop().run()

コマーシャルをミュート

blockify を使えばコマーシャルをミュートできます (Wine 版とネイティブの Linux クライアント両方で使えます)。AURblockifyAUR でインストールできます。

Spotify が起動するたびに blockify をバックグラウンドで実行されるようにするには:

#!/bin/sh

spotify=/usr/bin/spotify

if [[ -x $spotify && -x /usr/bin/blockify ]];
then
  blockify &
  block_pid=$!
  $spotify
  trap "kill -9 $block_pid" SIGINT SIGTERM EXIT
fi

上のスクリプトを /usr/local/bin/spotify に配置すれば、Spotify を起動したときに /usr/bin/spotify が優先されます。他に変更する必要があるところはありません。アップデートしても消えることはありません。

リモートコントロール

SSH でコマンドを送信

If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with

$ ssh user@host yourcommand

where yourcommand can be spotifycmdAUR that you installed on the server, or a dbus script for the linux version, as described above.

SSH で Spotify ウィンドウをつかむ

Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.

To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.

#!/bin/bash
# vncget.sh

if [[ $1 == all ]];then
  ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"
else
  ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"
fi
 
for i in {1..4}; do
  sleep 2
  if vncviewer localhost:0; then break; fi
done
#!/bin/bash
# vncgetspotify.sh

export DISPLAY=:0

id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')

x11vnc -sid $id -display :0 -auth .Xauthority

You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.

Finally, to grab the spotify window, run on the client:

$ sh vncget.sh

or, for the whole desktop:

$ sh vncget.sh all

トラブルシューティング

DWM で Spotify Linux を使用した時に画像が点滅したり正しく表示されない

Start spotify as a floating window.

You can add this rule to the rules array in your config.h:

 { "Spotify",     NULL,       NULL,        2,         True,     -1 },

This will tell dwm to start spotify as a floating window associated with the tag "2" no matter what window mode you are in. Recompile and install dwm to apply your new settings.

検索やブラウザ、ラジオが動作しない

Spotify bug report concerning non-english locales

If various tabs like browsing only show a blank screen, the search field doesn't seem to do anything or the radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale.

Spotify を起動する前に LC_NUMERIC 環境変数を en_US.utf8 に設定してみてください。

Spotify がローカルファイルを再生しない

This can manifest in a very unusual manner like some songs not playing when you try to stream them because the player attempts to play them from the hard drive.

Try installing ffmpeg-compat, as per this forum discussion.

SpotifyHelper.exe がクラッシュする (Windows クライアント)

Spotify を起動した時に SpotifyHelper.exe がクラッシュする場合、winecfg で d3d9 ライブラリを無効化してください。"Libraries" タブを開いて、"d3d9" を選んで Add をクリックしてください。無効化するには、edit をクリックして "Disable" オプションを選択してください。

ランチャーアイコンがおかしい (Windows クライアント)

ランチャーに Spotify アイコンが正しく表示されない場合、次の行を ~/.local/share/applications/wine/Programs/Spotify.desktop に追加してください:

StartupWMClass=spotify.exe

Pulseaudio

PulseAudio/トラブルシューティング[2] を見て下さい。

プロキシを使ったときにアルバム画像が表示されない、四角が表示される

spotify を終了して、spotify の設定 ~/.config/spotify/prefs を開いて下さい。

@https を @http に変更してください:

 network.proxy.addr="your-proxy.com:80@http"
 network.proxy.mode=2

See original form post here.

Spotify でローカルネットワーク上の他のデバイスが検出されない

ファイアウォールを使っている場合、UDP と TCP のポート 57621 を開いて下さい。iptablesシンプルなステートフルファイアウォールを使用している場合、以下で設定できます:

iptables -A TCP -p tcp --dport 57621 -j ACCEPT -m comment --comment spotify
iptables -A UDP -p udp --dport 57621 -j ACCEPT -m comment --comment spotify

It is also possible to restrict the source and destination to the local network.

参照