NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
1 2 3 4 5 … 93 Next »
Windows FM Radio support in v5.

 
  • 0 Vote(s) - 0 Average
Windows FM Radio support in v5.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,879
Threads: 954
Joined: May 2006
#11
2020-05-02, 02:13 PM (This post was last modified: 2020-05-12, 02:25 PM by mvallevand.)
Great that is what I wanted to hear.   I wasn't sure how well this would work in the wild


1. The next step is to install python3 and vlc and extra the attached python file somewhere. 

2. To run the setup for analog FM devices it is

python nextradio.py FM

If things work you will be prompted for the city that geo coding identified you in Canada or the US.  You will get the list of ID and station names that are found https://db.wtfda.org/fac_frequency/down/1 for your city.  There are options for other cities if some local stations are missing but we can do that later.

You will also be  prompted to get the Radiotime/Tunein stations for your city https://tunein.com/radio/local/ .  I would accept this because it adds channel icons for many radio stations.  There is an option to add pretty much any Radiotime city or category for the internet radio option, but that is for another thread.

3. Once that is done you should have a file C:\User\Public\NPVR-data\scripts\AnalogRadio.bat  Edit it and change the string "tuningname" to the device name you have used in the first step.

4.  Open NextPVR web and go to Settings->Devices   You should have an EXTRA device with type extra-AnalogRadio  If you don't see it hit rescan and ctrl-f5

5. Click on it, don't copy channels, and click Scan  and you should see something like this

6.  I suggest unticking all of them with the top left check box and accepting only stations you are interested in

You should have a mix of stations the were found on the two internet sites, but there will be dummy frequencies for every thing else.

7 Click save and you should have the channels in your guide, test and let us know


Martin


Attached Files Thumbnail(s)
   

.zip   NextRadio.zip (Size: 3.25 KB / Downloads: 52)
bourret.brandon
Offline

Junior Member

United States
Posts: 15
Threads: 2
Joined: Apr 2020
#12
2020-05-02, 06:11 PM
Very awewome! I'll get on this after work today. Thanks!
bourret.brandon
Offline

Junior Member

United States
Posts: 15
Threads: 2
Joined: Apr 2020
#13
2020-05-03, 05:11 AM
Can't get the Python script to work for me. I installed Python3 (version 3.8 I believe). And it's giving me grief over a "requests" module. I already tried "pip install requests" and got errors. Should I use a lower version of Python?
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,879
Threads: 954
Joined: May 2006
#14
2020-05-03, 07:12 AM (This post was last modified: 2020-05-03, 12:30 PM by mvallevand.)
I suspect you need

pip install requests
pip install bs4

Martin
bourret.brandon
Offline

Junior Member

United States
Posts: 15
Threads: 2
Joined: Apr 2020
#15
2020-05-12, 12:51 AM
(2020-05-03, 07:12 AM)mvallevand Wrote: I suspect you need

pip install requests
pip install bs4

Martin
I installed ActivePython 3.6 and at least got SOME action. But it threw errors.


D:\Downloads>python nextradio.py FM
Do you want to overwrite C:\Users\Public\NPVR-data\extra-AnalogRadio.xml (y/N) y
Do you want to include FM listings for Ottawa, ON (Y/n) n
Namespace(base='C:\\Users\\Public\\NPVR-data', cities=None, format='FM', limit=False, location='local', spacing=200)
Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket
    cnx.do_handshake()
  File "C:\Python36\lib\site-packages\OpenSSL\SSL.py", line 1907, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "C:\Python36\lib\site-packages\OpenSSL\SSL.py", line 1632, in _raise_ssl_error
    raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 595, in urlopen
    self._prepare_proxy(conn)
  File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
    conn.connect()
  File "C:\Python36\lib\site-packages\urllib3\connection.py", line 326, in connect
    ssl_context=context)
  File "C:\Python36\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Python36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 448, in wrap_socket
    raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\requests\adapters.py", line 449, in send
    timeout=timeout
  File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Python36\lib\site-packages\urllib3\util\retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='opml.radiotime.com', port=443): Max retries exceeded with url: /Browse.ashx?c=local&render=json&partnerId=HyzqumNX (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nextradio.py", line 216, in <module>
    radiotime()
  File "nextradio.py", line 89, in radiotime
    r = requests.get('https://opml.radiotime.com/Browse.ashx?c=local&render=json&partnerId=HyzqumNX')
  File "C:\Python36\lib\site-packages\requests\api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Python36\lib\site-packages\requests\api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Python36\lib\site-packages\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Python36\lib\site-packages\requests\sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "C:\Python36\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='opml.radiotime.com', port=443): Max retries exceeded with url: /Browse.ashx?c=local&render=json&partnerId=HyzqumNX (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,879
Threads: 954
Joined: May 2006
#16
2020-05-12, 12:56 AM
Perhaps try standard python from python.org

If Ottawa is coming up I your list I have to check my code I might have something had coded.

Martin
bourret.brandon
Offline

Junior Member

United States
Posts: 15
Threads: 2
Joined: Apr 2020
#17
2020-05-12, 01:43 AM
(2020-05-12, 12:56 AM)mvallevand Wrote: Perhaps try standard python from python.org

If Ottawa is coming up I your list I have to check my code I might have something had coded.

Martin

Certainly, and thanks for working with me on this! I've uninstalled ActivePython, and I'm trying plain vanilla Python 3 (latest release) now.

A problem I had with this before is pip throwing errors when I tried to install libraries. I'll keep you posted.
bourret.brandon
Offline

Junior Member

United States
Posts: 15
Threads: 2
Joined: Apr 2020
#18
2020-05-12, 01:52 AM
D:\Downloads>python nextradio.py FM
Traceback (most recent call last):
File "nextradio.py", line 5, in <module>
import requests
ModuleNotFoundError: No module named 'requests'

D:\Downloads>pip --trusted-host pypi.org install requests
Collecting requests
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', FileNotFoundError(2, 'No such file or directory'))': /simple/requests/
ERROR: Could not find a version that satisfies the requirement requests (from versions: none)
ERROR: No matching distribution found for requests
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,879
Threads: 954
Joined: May 2006
#19
2020-05-12, 02:00 AM
I use pip install requests and pip install bs4. Make sure it is python 3

Martin
bourret.brandon
Offline

Junior Member

United States
Posts: 15
Threads: 2
Joined: Apr 2020
#20
2020-05-12, 02:12 AM
(2020-05-12, 02:00 AM)mvallevand Wrote: I use pip install requests and pip install bs4. Make sure it is python 3

Martin

Finally SUCCESS!!! Turns out Python changes rapidly, and each delta has a different install method/destination. For the record (and for others maybe having issues), I had to use Python 3.7.5 (Win 64-bit). Then magically pip installed 'requests' and 'bs4' with no issues, and Python ran your script very well. It still asked about Ottawa, but the second prompt was for my correct location.



D:\Downloads>python nextradio.py FM
Do you want to overwrite C:\Users\Public\NPVR-data\extra-AnalogRadio.xml (y/N) y
Do you want to include FM listings for Ottawa, ON (Y/n) n
Namespace(base='C:\\Users\\Public\\NPVR-data', cities=None, format='FM', limit=False, location='local', spacing=200)
Do you want to include Radiotime stations for  Colorado Springs, CO (Y/n) Y
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (13): « Previous 1 2 3 4 5 … 13 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  FM tuner support in NextPVR? Goongyae 2 1,361 2022-11-23, 01:22 PM
Last Post: mvallevand
  IPTV like stream from Sound Card input - FM Radio Project NumberFive 3 1,360 2022-11-20, 04:28 PM
Last Post: mvallevand
  IPTV Pretuning and Internet Radio mvallevand 5 3,157 2019-02-04, 12:02 AM
Last Post: mvallevand
  Problems with Windows UWP App spitefulgod 4 3,803 2016-12-15, 08:35 PM
Last Post: spitefulgod
  Any ideas about programming for Windows Firewall? bgowland 4 5,618 2014-04-10, 09:05 AM
Last Post: bgowland
  Windows Shortcuts ACTCMS 4 2,711 2012-03-24, 12:22 AM
Last Post: mvallevand
  Creating a Windows service McBainUK 8 3,359 2011-03-30, 03:29 AM
Last Post: mvallevand
  Which channel logo image formats does npvr support? bgowland 2 2,067 2011-03-06, 05:43 AM
Last Post: bgowland
  Webservice API to support Android App development Barsk 4 3,253 2010-10-19, 07:31 AM
Last Post: Barsk
  Using Windows file system shortcuts ACTCMS 0 1,797 2010-01-26, 11:45 PM
Last Post: ACTCMS

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode