Jump to content

New project: locast2dvr


wouterdebie

Recommended Posts

wouterdebie

Hi all,

I spent some time on a new project: locast2dvr. It's somewhat of a rewrite of locast2plex with added functionality. Obviously massive thanks to the folks that wrote locast2plex!

I decided to rewrite since I wanted to add functionality:

  • Automatically downloads FCC facilities for station matching
  • Ability to not only act as a HDHomerun tuner, but also as an m3u tuner, 
  • Ability to provide EPG data from Locast as XMLTV
  • Run multiple instances in order to stream from multiple Locast locations
  • Multiplex multiple instances in order to have Emby connect to only one server and one EPG

Any todo's are captured as Github issues, but any feedback is welcome!

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Nice additions.

Out of curiosity does it do recording as well?  Just wondering because it has "DVR" in the name.

Link to comment
Share on other sites

wouterdebie

Hi!

Thanks! I doesn't record, since Emby can already do that. Maybe I should have named it locast2mediacenter or something, but as you might know.. naming is hard.

Link to comment
Share on other sites

wouterdebie

It also works with Plex :) Although there are more features that Emby can leverage..

Edited by wouterdebie
Link to comment
Share on other sites

mark-in-dallas
22 hours ago, cayars said:

Plex??? What's a plex? LOL

Dictionary definition:  A once decent, but now overly commercialized software application for viewing media approved by the overlords managing the Plex application, or other media sources in which they are able to negotiate commissions or kickbacks with.

Alternatively:  a metallurgy process similar to tempering steel, in which it becomes more pliant and malleable.  Oh wait, that would be Flex not Plex, my bad.  LOL

Edited by mark-in-dallas
  • Like 1
Link to comment
Share on other sites

Does this work on Windows if I install python and pip, has it been tested.  Or should I just break down and spin up another Linux VM?

Link to comment
Share on other sites

If you already have python/pip installed on windows just try it.  You can easily remove it if it doesn't work, leaving no trace of it.

 

Link to comment
Share on other sites

wouterdebie

I have not tried this on windows, but I'd love to know if it works or not and possibly fix bugs. You could install it in a separate python venv, so it won't break any other install.

Link to comment
Share on other sites

Installing python 3.latest on Windows.  Will test and advise. 

Question - Is there an advantage to using the locast epg in Emby?  Couldn't we make use of the Emby EPG once the tuner is installed?

Link to comment
Share on other sites

The Windows install failed at building Levenshtein 
 -- Wheel was not installed.
Installed wheel via pip as it was not included in default package. (pip install wheel)
 -- Next Error message "error: Microsoft Visual C++ 14.0 is required." so I 
Installed Windows 10 SDK & C++ x64/x86 build tools from Microsoft Visual C++ 14.0 - Check out this article for specifics - https://www.scivision.dev/python-windows-visual-c-14-required/

The install then completed.

Still working on
- path to config file.  Seems to be not working with any of the conventions for converting from a Linux path to Windows path, but I got it to work from command line.
- XML TV Guide from locast, it doesn't seem to be populating so I'm using the Emby guide

A little testing required, but it is working.

  • Like 1
Link to comment
Share on other sites

wouterdebie
8 hours ago, cayars said:

Hi, yes you will likely find the Emby provided data for Locast to be best.

This is true. I started with Emby's EPGs, but using "Local Over The Air" didn't always map correctly. Secondly, with locast2dvr you can specify multiple regions and it will provide all the EPG data through one url, so you only need one Tuner and One EPG, instead of multiple.

  • Like 1
Link to comment
Share on other sites

wouterdebie
8 hours ago, richt said:

The Windows install failed at building Levenshtein 
 -- Wheel was not installed.
Installed wheel via pip as it was not included in default package. (pip install wheel)
 -- Next Error message "error: Microsoft Visual C++ 14.0 is required." so I 
Installed Windows 10 SDK & C++ x64/x86 build tools from Microsoft Visual C++ 14.0 - Check out this article for specifics - https://www.scivision.dev/python-windows-visual-c-14-required/

Did you try to install Visual Studio to build Levenshtein? Locast2dvr does some fuzzy matching for FCC facilities and channel names and prefers the C implementation of levensthein, but should work without it. I might be able to make an exception in setup.py for windows.

 

8 hours ago, richt said:

The install then completed.

Still working on
- path to config file.  Seems to be not working with any of the conventions for converting from a Linux path to Windows path, but I got it to work from command line.
- XML TV Guide from locast, it doesn't seem to be populating so I'm using the Emby guide

A little testing required, but it is working.

The path stuff was one of the things I was expecting to fail. For the cache dir I use pathlib.Path.home(), which should work for windows as well. Can you check? What's the exact error with the path to config file? I don't do any magic there.

Link to comment
Share on other sites

42 minutes ago, wouterdebie said:

Secondly, with locast2dvr you can specify multiple regions and it will provide all the EPG data through one url, so you only need one Tuner and One EPG, instead of multiple.

That is very cool indeed!

Link to comment
Share on other sites

1 hour ago, wouterdebie said:

Did you try to install Visual Studio to build Levenshtein? Locast2dvr does some fuzzy matching for FCC facilities and channel names and prefers the C implementation of levensthein, but should work without it. I might be able to make an exception in setup.py for windows.

The Windows 10 SDK & C++ x64/x86 build tools from Microsoft Visual C++ 14.0 I installed were all I needed from Visual Studio to complete the build of Levenshtein.

 

1 hour ago, wouterdebie said:

The path stuff was one of the things I was expecting to fail. For the cache dir I use pathlib.Path.home(), which should work for windows as well. Can you check? What's the exact error with the path to config file? I don't do any magic there.

I'll get the error message later.  Multiple messages on multiple format attempts.   I had just temporarily dropped the config file in c:\test.  A couple of my attempts included the following:

--config c:\test\configfile
--config c://test//configfile

 

Link to comment
Share on other sites

wouterdebie

I forgot I had a Windows 10 laptop laying around, so I installed python and got it working. A few things:

  • I removed the python-levenshtein dependency, since it's purely an optimization for python-fuzzywuzzy and given that not much data is fuzzy matched, it doesn't really matter.
  • I found a bug with timestamp parsing. Windows' C library doesn't allow for negative timestamps, so I created a workaround and that seemed to work.
  • I didn't encounter the config file issue. I can run --config c:\User\myuser\config.

What I did to install and run:

- Install Python from the windows app store (or whatever it's called). Running python 3.9
- Open cmd.exe
- Run 'python -m venv venv'
- Run 'venv\Scripts\Activate'
- Run 'pip install locast2dvr'
- Create a config file
- Run 'locast2dvr --config C:\path\to\config'

My config:

username="mylocastusername"
password="mylocastpassword"
uid="WOUTER"
verbose="1"
override_zipcodes="90210"

 

Edited by wouterdebie
Link to comment
Share on other sites

  • 1 month later...
mlcarson

What does Locast2DVR do that the fHDHR_Locast addon doesn't?   It appears that M3U is an added option over just HDHomerun tuners but is that the main difference?   I haven't played much with either yet. 

Link to comment
Share on other sites

mlcarson

fHDHR_Locast has a brother named fHDHR_USTVGO.   It's not currently working so there's another project if you want one...    So with locast2dvr, what limitations have you found with location?   You state that different instances can go to different DMA's as long as you are overriding the zipcode.  Has Locast said anything about this?  I was afraid to even have the billing address different than the local DMA.  It would be nice to have both an east coast and a west-coast DMA for different channels but was afraid that would raise some red flags since they seem to be serious about enforcing the DMA zone on signup. 

Link to comment
Share on other sites

24 minutes ago, mlcarson said:

fHDHR_Locast has a brother named fHDHR_USTVGO.   It's not currently working so there's another project if you want one...    So with locast2dvr, what limitations have you found with location?   You state that different instances can go to different DMA's as long as you are overriding the zipcode.  Has Locast said anything about this?  I was afraid to even have the billing address different than the local DMA.  It would be nice to have both an east coast and a west-coast DMA for different channels but was afraid that would raise some red flags since they seem to be serious about enforcing the DMA zone on signup. 

Unless Locast has changed this in the last month they will cut off streams that have a DMA different from the IP region.

Link to comment
Share on other sites

mlcarson
53 minutes ago, cayars said:

Unless Locast has changed this in the last month they will cut off streams that have a DMA different from the IP region.

I'll eventually let you know.  I'm about 75 miles away from the DMA boundary that I want and am no longer using a VPN but rather just the override coordinates.   If I get disconnected, I'll go back to an always-on VPN and create a new account if I have to but so far so good.  Most of the networks aren't even available OTA in the DMA that I'm in.    That's why I was curious about how strict Locast was being.   It'd be pretty simple to find a user connecting to multiple DMA's at the same time or a DMA that was different than the billing DMA but a little more difficult to say that an IP address that they see in a neighboring DMA couldn't be in the appropriate DMA if the appropriate geocoordinates were provided. 

Link to comment
Share on other sites

wouterdebie

I haven't seen any issues with this currently. Technically they could check an IP against a DMA, but they don't seem to care for now. They seem to keep track of your last DMA, since they return it in the user data, but it seems they're not using it. 

In most cases an organization like locast doesn't really care, but they have to deal with organizations like the FCC. Having done this at a music streaming company in the past, the governing body cares about this, but if you show them how you contain users and at the same time give them an opportunity to use the product as you intend it (e.g. locast subscribers should be able to move from region to region), they are mostly fine.

Overriding the dma isn't a trick at all, but seems to be designed to be allowed. So locast2dvr doesn't do anything weird or doesn't obfuscate anything. It merely uses the API's that are available.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...