forked from coderholic/pyradio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows.html
204 lines (200 loc) · 16.3 KB
/
windows.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Running PyRadio on Windows</title>
<style>
html {margin: 2em;}
h2 {margin-top: 2.5em; border-bottom:1px solid #D6D6D6;}
h3 {margin-top: 2.5em; border-bottom:1px solid #D6D6D6;}
dl {margin: 2em;}
dd {margin: 1em;}
dt {font-weight: bold;}
pre { background-color: #F6F6F6; padding: 1.5em; border: 1px solid #E6E6E6; overflow: auto;}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
</header>
<h1 id="pyradio">PyRadio</h1>
<p>Command line internet radio player.</p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
<h2 id="table-of-contents">Table of contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<ul>
<li><a href="#running-pyradio-on-windows">Running PyRadio on Windows</a></li>
<li><a href="#how-it-all-works">How it all works</a></li>
<li><a href="#installation">Installation</a>
<ul>
<li><a href="#python-installation">1. Python installation</a>
<ul>
<li><a href="#installing-python">1.1 Installing Python</a></li>
<li><a href="#verifying-the-installation">1.2 Verifying the installation</a></li>
</ul></li>
<li><a href="#mplayer-installation">2. MPlayer installation</a>
<ul>
<li><a href="#adding-mplayer-to-the-path">2.1 Adding MPlayer to the PATH</a></li>
</ul></li>
<li><a href="#git-installation-optional">3. Git installation (optional)</a></li>
<li><a href="#pyradio-installation">4. PyRadio installation</a>
<ul>
<li><a href="#using-git">4.1 Using Git</a></li>
<li><a href="#not-using-git">4.2 Not using Git</a></li>
<li><a href="#final-steps">4.3 Final steps</a></li>
</ul></li>
<li><a href="#updating-pyradio">5. Updating PyRadio</a>
<ul>
<li><a href="#updating-with-git">5.1 Updating with Git</a></li>
<li><a href="#updating-without-git">5.2 Updating without Git</a></li>
</ul></li>
</ul></li>
<li><a href="build.html">Back</a></li>
<li><a href="README.html">Back to README</a></li>
</ul>
<h2 id="running-pyradio-on-windows">Running PyRadio on Windows <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>What? A linux console application on Windows?</p>
<p>Yes, sure. Why not?</p>
<p><strong>PyRadio</strong> is a <em>python</em> script after all, and <em>python</em> does run on Windows. So, with a little bit of tweaking of the code, it is possible.</p>
<p>This page will guide you through the process of installing, updating and running <strong>PyRadio</strong> on Windows.</p>
<h2 id="how-it-all-works">How it all works <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>First of all, let me tell you that if you are still running Windows XP, you can just stop reading right now; it won’t happen…</p>
<p>Then, due to reasons that are of no importance right now, <a target="_blank" href="http://www.mplayerhq.hu/design7/news.html">MPlayer</a> is the only player that can be used. Furthermore, special care has to be taken in order to be able to save the volume of the player.</p>
<p>Other than that, you will have a fully functional <strong>PyRadio</strong> installation.</p>
<p>Having said that, let us proceed with the installation.</p>
<h2 id="installation">Installation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>The installation consists of three (optionally four) steps:</p>
<ol type="1">
<li><strong>Python</strong> installation</li>
<li><strong>MPlayer</strong> installation</li>
<li><strong>Git</strong> installation (optional)</li>
<li><strong>PyRadio</strong> installation</li>
</ol>
<h3 id="python-installation">1. Python installation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h3>
<h4 id="installing-python">1.1 Installing Python</h4>
<p>If you don’t already have <strong>Pyhton</strong>, just get to its <a target="_blank" href="https://www.python.org/downloads/windows/">Windows Downloads</a> page and download the latest <strong>3.x</strong> release.</p>
<p>When the download is done, run its setup and select “<em>Custom Installation</em>” so that you can “<em>Add Python to environment varaibles</em>”. You can refer to the following image to see the relevant setting.</p>
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/python1.jpg">Python Installation</a></p>
<h4 id="verifying-the-installation">1.2 Verifying the installation</h4>
<p>Either if you have just installed <strong>Python</strong> or you already have it installed, you need to verify that its executable is in the <strong>PATH</strong> (i.e. <strong>Python</strong> can be executed from a console by typing“<em>python</em>”).</p>
<p>So, go ahead and open a console (the command is <strong>cmd</strong>) and type <strong>python</strong>.</p>
<p>If you get something similar to the following snippet, you are good to go.</p>
<pre>Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win
Type "help", "copyright", "credits" or "license" for more information.
>>></pre>
<p>If the command could not be found, you have to run the installation again, select “<em>Modify</em>” and set the “<em>Add Python to environment varaibles</em>” option. You can refer to the following image to see the relevant setting.</p>
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/python2.jpg">Python Installation Modification</a></p>
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> If you don’t have the setup file of the original <strong>Python</strong> installation, you will have to <strong>download</strong> it from <a target="_blank" href="https://www.python.org/downloads/windows/">Python’s Windows Downloads</a>. In case you want to upgrade to the latest version, you <strong>must uninstall</strong> the one currently installed, beforehand.</p>
<h3 id="mplayer-installation">2. MPlayer installation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h3>
<p>Go to <a target="_blank" href="http://www.mplayerhq.hu/">MPlayer’s home</a> and open the <a target="_blank" href="http://www.mplayerhq.hu/design7/dload.html">download</a> page. Then scroll down to the <strong>Binaries</strong> section and get to the <a target="_blank" href="http://oss.netfarm.it/mplayer/">MPlayer Windows builds</a> page. Then scroll down again until you get to the <strong>Build selection table</strong> to select an installation bundle.</p>
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> I am stating here all the links, although all one has to do is get to the last one and download the <strong>MPlayer setup</strong>. This is done so that in case any of the links change in the future, the way to go will be known, having <a target="_blank" href="http://www.mplayerhq.hu/">MPlayer’s home page</a> as a starting point.</p>
<p>You will end up downloading a <strong>7z archive</strong>, which contains a directory whose name is similar to <strong>MPlayer-corei7-r38135+gb272d5b9b6</strong>.</p>
<p>Extract this directory to whatever place you like and <strong>rename</strong> it to <strong>mplayer</strong>.</p>
<p>Here comes the tricky part…</p>
<p>In case you:</p>
<ol type="a">
<li>are the Administrator of the PC, or</p></li>
<li>have administrative rights</p></li>
</ol>
<p>move (cut) the <strong>mplayer</strong> directory to <strong>C:\</strong> (paste).</p>
<p>Make a note that you will add “<strong>C:\mplayer</strong>” to PATH.</p>
<p>In any other case, move the <strong>mplayer</strong> directory to either on of the following locations:</p>
<ol type="a">
<li><strong>%USERPROFILE%</strong></p>
<p>This is actually your “<em>Home</em>” directory.</p>
<p>Please make a note that you will add "<strong>%USERPROFILE%\mplayer</strong> to PATH.</p></li>
<li><strong>%APPDATA%\pyradio</strong></p>
<p>This is (or will be) “<em>PyRadio’s configuration directory</em>”.</p>
<p>In case the <strong>pyradio</strong> directory does not exit, you just go ahead and create it.</p>
<p>(Make a note that you will add "<strong>%APPDATA%\pyradio\mplayer</strong> to PATH)</p></li>
</ol>
<p>In either case, in order to do that, open an <strong>Explorer File Manager</strong> window, and enter at its location field <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong>.</p>
<p>If you are unsure on how to do that, please refer to the following image (you can ENTER <strong>%USERPROFILE%</strong> or <strong>%APPDATA%</strong> or any other Windows System Variable this way).</p>
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/appdata.jpg">Navigating to %APPDATA%</a></p>
<h4 id="adding-mplayer-to-the-path">2.1 Adding MPlayer to the PATH</h4>
<p>The final step is to add MPlayer to the PATH System Variable.</p>
<p>Now, you already know the string that has to be added (you have made a note of it in the previous step).</p>
<p>There’s just one thing to say here: Windows provide a “<em>User variable for User</em>” and a “<em>System variables</em>” section in the “<em>Environment Variables</em>” window.</p>
<p>If the string to add is “<strong>C:\mplayer</strong>”, you add it to the “<em>System variables</em>” section, otherwise to the “<em>User variables for User</em>” section.</p>
<p>In order to make the actual addition, please refer to the following image.</p>
<p><a target="_blank" href="https://members.hellug.gr/sng/pyradio/path.jpg">Adding MPlayer to the PATH</a></p>
<p>After applying the changes you should <strong>log off and back on</strong> or <strong>restart the system</strong>, because changes done to the PATH variable will take effect the next time you log into the system.</p>
<p>When you are back on, verify that you can run <strong>MPlayer</strong>; open a console (press the <strong>Win</strong> key, type <strong>cmd</strong> and press <strong>ENTER</strong>) and type “<strong>mplayer</strong>”.</p>
<p>If you get something similar to the following snippet, you are all good.</p>
<pre>MPlayer Redxii-SVN-r38119-6.2.0 (x86_64) (C) 2000-2018 MPlayer Team
Using FFmpeg N-92801-g7efe84aebd (2018-12-25 00:44:17 +0100)
Compiled on 2018-12-25 13:55:17 EST (rev. 1)
Usage: mplayer [options] [url|path/]filename</pre>
<p>If <strong>mplayer</strong> was not found, you just have to go through the PATH modification procedure again.</p>
<h3 id="git-installation-optional">3. Git installation (optional) <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h3>
<p>This is an optional step, so if you do not want to install yet another program to your PC, you are free to skip it.</p>
<p>Having said that, why would you install <strong>Git</strong>?</p>
<p>Well, it makes installing and updating <strong>PyRadio</strong> much easier and faster. That’s all.</p>
<p>If you decide to install it, this is how you do it:</p>
<ol type="1">
<li>Download the latest <a target="_blank" href="https://gitforwindows.org">Git for Windows</a> installer.</p></li>
<li>When you’ve successfully started the installer, you should see the <strong>Git Setup wizard</strong> screen. Follow the <strong>Next</strong> and <strong>Finish</strong> prompts to complete the installation. The default options are pretty sensible for most users.</p></li>
<li>Open a console (press the <strong>Win</strong> key, type <strong>cmd</strong> and press <strong>ENTER</strong>).</p></li>
<li>Run the following commands to configure your Git username and email using the following commands, using you name and email at the appropriate places:</p></li>
</ol>
<pre>git config --global user.name "FirstName LastName"
git config --global user.email "my@email.com"</pre>
<p>You are done!!!</p>
<h3 id="pyradio-installation">4. PyRadio installation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h3>
<p>At last!</p>
<p>You are ready to install <strong>PyRadio</strong>!</p>
<p>So here’s how you do it:</p>
<h4 id="using-git">4.1 Using Git</h4>
<p>If you have Git installed, you open a console (press the <strong>Win</strong> key, type <strong>cmd</strong> and press <strong>ENTER</strong>) and type:</p>
<pre>git clone https://github.com/coderholic/pyradio.git
cd pyradio
devel\build_install_pyradio</pre>
<h4 id="not-using-git">4.2 Not using Git</h4>
<p>Go to <a target="_blank" href="https://github.com/coderholic/pyradio/releases">PyRadio’s Releases page</a> and download the latest release (either a zip or a tar.gz file).</p>
<p>Extract this file to your “<em>Home</em>” directory (“<strong>C:\Users\[Your User Name]</strong>” or “<strong>%USERPROFILE%</strong>) - you will get a directory whose name is similar to”<strong>pyradio-0.7.9</strong>".</p>
<p>I will use this name for the following examples; you will have to use the actual name of directory you got from the extraction.</p>
<p>Then open a console (press the <strong>Win</strong> key, type <strong>cmd</strong> and press <strong>ENTER</strong>) and type:</p>
<pre>cd pyradio-0.7.9
cd pyradio
devel\build_install_pyradio</pre>
<h4 id="final-steps">4.3 Final steps</h4>
<p>If the installation is successful, you will get something similar to the following snippet:</p>
<pre>...
Installing pyradio-script.py script to C:\Users\spiros\AppData\Local\Programs\Python\Python37\Scripts
Installing pyradio.exe script to C:\Users\spiros\AppData\Local\Programs\Python\Python37\Scripts
Installed c:\users\spiros\appdata\local\programs\python\python37\lib\site-packages\pyradio-0.7.9-py3.7.egg
Processing dependencies for pyradio==0.7.9
Finished processing dependencies for pyradio==0.7.9
*** HTML files copyed to "C:\Users\spiros\AppData\Roaming\pyradio\help"
=== Player "mplayer" found in "C:\Users\spiros\mplayer"
=== Player "mplayer" found in PATH
*** Installing Dekstop Shortcut
Installation successful!
</pre>
<p>Finally, install <strong>PyRadio’s Python packages</strong> requirements:</p>
<pre>pip install windows-curses
pip install pywin32</pre>
<p>And you are done!</p>
<p>If you are not using Git, you can safely delete the <strong>pyradio-0.7.9</strong> directory.</p>
<p>Finally, you can type <strong>pyradio</strong> and enjoy!</p>
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> For your convenience, the installation batch file has tried to installed a shortcut on your Desktop. You can use it to launch <strong>PyRadio</strong> and optionally modify it (change font size, window dimensions, etc). If it’s not there, you can just copy it from the “<em>help</em>” directory of the <strong>Explorer File Manager</strong> which will open after executing <strong>pyradio -ocd</strong>.</p>
<h3 id="updating-pyradio">5. Updating PyRadio <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h3>
<p><strong>PyRadio</strong> will inform you when a new release is available.</p>
<p>To start the update procedure, close <strong>Pyradio</strong> if it’s still running.</p>
<p>Then do one of the following depending on whether you have <strong>Git</strong> installed or not:</p>
<h4 id="updating-with-git">5.1 Updating with Git</h4>
<p>Open a console (press the <strong>Win</strong> key, type <strong>cmd</strong> and press <strong>ENTER</strong>) and execute the commands:</p>
<pre>cd pyradio
git pull
devel\build_install_pyradio</pre>
<h4 id="updating-without-git">5.2 Updating without Git</h4>
<p>The procedure is the same as installing, so please follow the <a href="#not-using-git">relevant instructions</a>.</p>
</body>
</html>