wouterdebie / locast2tuner

Locast to Emby/Plex/Channels server
https://wouterdebie.github.io/locast2tuner/
MIT License
52 stars 8 forks source link

Account Says Donation Required #85

Closed MapGuy11 closed 3 years ago

MapGuy11 commented 3 years ago

NOTE THAT UNCLEAR BUG REPORTS (i.e. without the information requested below like logs, settings, versions, etc) MIGHT BE CLOSED WITHOUT ANY HELP!!

Describe the bug So my Locast account is under the Locast EA/Cares program and since it pretty much as a obscene amount of money that cannot be expired so what happens is it looks for the Donation it says donation expired though the amount in the account is crazy. In Locast it recognizes that I have donated and doesn't give me any ads or donation links. Is there a way to bypass the check as the account does work with all of Locast's app though I want to use other apps to consume their content. To Reproduce Steps to reproduce the behavior:

  1. After Booting Container For The First Time It Panics with a Donation Expired.

Logs config selected = /app/config/config

Aug 19 17:52:54.884 INFO locast2tuner 0.2.5 on Linux 5.4.119-1-pve starting.. Aug 19 17:52:54.884 INFO UUID: 1130c704-c2d1-4ecd-b7dd-a25118276558 Aug 19 17:52:54.884 INFO Logging in with {redacted} Aug 19 17:52:55.122 INFO Login succeeded! thread 'main' panicked at 'Donation expired! Make sure you have an active donation at locast.org!', src/credentials.rs:103:17 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace /app/run.sh: line 8: 8 Aborted (core dumped) /app/locast2tuner -b 0.0.0.0 -d 8 --tuner_count 4 $config Configuration

### Mandatory configuration
username = ""
password = ""

### Optional configuration

## Address of the interface to bind to. The default value is 127.0.0.1 (localhost). To bind to all
## interfaces, use 0.0.0.0
# bind_address = "127.0.0.1"

## What zip codes to override. By default this is not set and locast2tuner will use your external IP
## to determine your location.
#
# Please see https://www.locast.org/dma for a current map of the supported regions
#
override_zipcodes = ["19508","17721","10001"]

## How many days of EPG data to fetch. The default is 8, which is the maximum of data locast.org provides
# days = 8

## Verbosity. 0 = Info, 1 = Info + HTTP request lgos, 2 = Debug, 3 = Trace.
## In error logs, you might see "run with `RUST_BACKTRACE=1` environment variable to display a backtrace".
## Setting the verbosity to 2 or 3 will also include the backtrace.
# verbose = 1

## Enable RUST_BACKTRACE=1. In error logs, you might see "run with `RUST_BACKTRACE=1` environment variable
## to display a backtrace". Instead of adding the environment variable, you can enable this behavior with
## rust_backtrace.
rust_backtrace = true

## TCP port to bind to. The default is 6077. In case you override muliple zip codes, locast2tuner will
## bind to multiple ports, starting at the number specified below (or default 6077). Any additional
## instance will bind to a port incremented by 1. E.g. if you override 3 zip codes, 3 instances will
## be started and bound to 6077, 6078 and 6079. In order to only use one instance, use "multiplex"
## (see below).
# port = 6077

## The amount of tuners that is communicated to Plex. This will limit the amount of streams that Plex will
## allow. Note that this is not a limitation in locast2tuner.
# tuner_count = 3

## Disable caching of station information. By default locast2tuner caches station information for an hour
## (see cache_timeout below). By disabling the cache, every request for station information will lead
## to a call to locast.org. Normally you shouldn't have to disable the cache.
# disable_station_cache = false

## How often (in seconds) the station cache is refreshed.
# cache_timeout = 3600

## Where to save station data
# cache_dir = "/var/lib/locast2tuner" # default: $HOME/.locast2tuner

## Normally, when you override multiple zip codes, locast2tuner starts multiple instances (see "bind_address"),
## but with "multiplex = true", stations from multiple locations will be available through a single instance.
# multiplex = false

## Remap channel numbers when multiplexing. In case you override multiple zip codes, Emby and Plex will sort
## channels by channel number, which means channels from different locations might be intermingled. In order
## circumvent this, you can use "remap = true". This causes locast2tuner to rewrite the channel number based
## on the amount of instances there are. Locast will remap a "channel_number" to
## "channel_number + 100 * instance_number", where the instance_number starts at 0.
## E.g. you override 3 zip codes, then the channels from the first location will be untouched (since 100*0 == 0),
## the stations for the second location will start at 100 (e.g. 2.1 CBS becomes 102.1 CBS) and the stations
## for the third location will start at 200 (e.g. 13.2 WWFF becomes 213.2 WWFF).
##
## Another mutually exclusive way of remapping appears below. Please only specify one option, but if you do
## use both, then "remap" will take precedence.
# remap = false

## Remap channels based off a JSON definition file. You specify a JSON file containing your remappings.
## To get your current mappings, you can go to "http://PORT:IP/map.json". Copy that content to a JSON
## file (you'll want to pretty it up too to make it easier to work with) and you can edit that JSON file,
## save it, and then use this option to load those remappings the next time you run locast2tuner. You
## will need to restart locast2tuner in order to see any changes you made (and you may need to recreate
## your tuner/EPG setup to have Plex or Emby reflect the right channels). ***NOTE*** This is currently
## a manual edit process, so if you want to go this route, please be sure that the JSON content is valid
## JSON before trying to use it. A web-based remap editor is in the works.
# remap_file = "remap.json"

## Device firmware that is reported to Plex or Emby. Defaults to "homerun3_atsc"
# device_firmware = "homerun3_atsc"

## Device model that is reported to Plex or Emby. Defaults to "HDHR3-US"
# device_model = "HDHR3-US"

## Device version that is reported to Plex or Emby. Defaults to "20170612"
# device_version = "20170612"

## Don't log anything to the terminal
# quiet = false

## Log through syslogd
# syslog = false

## Log to a specific file. By default locast2tuner will not log to a file.
# logfile = "locast2tuner.log"

## Don't include tvc_guide_station in tuner.m3u. Having this field sometimes breaks things in Channels DVR.
# no_tvc_guide_station = false

Environment Proxmox LXC Container Locast 2 Tuner Version: 0.2.5 Screenshots If applicable, add screenshots to help explain your problem.

Environment Ubuntu 18.04 LTS Docker w/ Portainer - Linux 5.4.119-1-pve Additional context Add any other context about the problem here.

wouterdebie commented 3 years ago

Very interesting! I could add an option to bypass the donation check, but I'd be curious to see what data your account holds compared to mine. Would you mind running the following script and paste the output here? (substitute the username and password)

token=$(curl -X POST -d '{"username": "YOURUSERNAME", "password":"YOURPASSWORD", "captcha":"foo"}' -H 'Content-Type: application/json' 'https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D' | sed s/{\"token\":\"//g | sed s/\"}//g)
curl -s -H "Authorization: Bearer $token" 'https://api.locastnet.org/api/user/me'

Thanks!

wouterdebie commented 3 years ago

In the mean time, I'm looking at the data I get back and it seems that locastCaresApplicationDate is returned. In my case it's null, but I'm curious to see what it looks like on your end. I assume that is what will be set if you qualify for Locast Cares.

wouterdebie commented 3 years ago

I think you missed a piece..

MapGuy11 commented 3 years ago

I think you missed a piece..

Ok I'll try again.

MapGuy11 commented 3 years ago
{"id":40114,"name":"*","created":1541435852000,"password":"*","lastlogin":1629399634719,"realname":"*","idrole":1,"didDonate":true,"email":"*","lastDonation":1550255142000,"donationExpire":1587362400000,"lastDonationAmount":5.0,"totalDonations":5.0,"subscriptionProvider":"paypal","lastDmaUsed":504,"emailConfirmed":true,"parentIdUser":null,"emailOptOut":false,"lastPlayEvent":1629395345676,"signupSource":null,"signupIp":null,"locale":null,"locastCaresApplicationDate":null,"facebook":null}
wouterdebie commented 3 years ago

Thanks! Unfortunately there's nothing in the data that tells me that you have a Locast Cares account. What I'll do is add an option that allows you to disable the donation check..

MapGuy11 commented 3 years ago

Thanks! Unfortunately there's nothing in the data that tells me that you have a Locast Cares account. What I'll do is add an option that allows you to disable the donation check..

Thank You that should make it work!

wouterdebie commented 3 years ago

Fixed in 0.2.7. Should be built in a few mins