1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +01:00

Rename old service names to the new one

fixes: #1369
This commit is contained in:
Johan Andersson 2021-05-13 22:07:39 +02:00
parent 494c9e3eb7
commit 0ae0b6ae54
4 changed files with 20 additions and 6 deletions

View File

@ -17,7 +17,7 @@ country = {"sv": ".se", "da": ".dk", "no": ".no"}
REALMS = {"discoveryplus.se": "dplayse", "discoveryplus.no": "dplayno", "discoveryplus.dk": "dplaydk"} REALMS = {"discoveryplus.se": "dplayse", "discoveryplus.no": "dplayno", "discoveryplus.dk": "dplaydk"}
class Dplay(Service): class Discoveryplus(Service):
supported_domains = ["discoveryplus.se", "discoveryplus.no", "discoveryplus.dk"] supported_domains = ["discoveryplus.se", "discoveryplus.no", "discoveryplus.dk"]
packages = [] packages = []

View File

@ -4,7 +4,7 @@ from svtplay_dl.service.barnkanalen import Barnkanalen
from svtplay_dl.service.bigbrother import Bigbrother from svtplay_dl.service.bigbrother import Bigbrother
from svtplay_dl.service.cmore import Cmore from svtplay_dl.service.cmore import Cmore
from svtplay_dl.service.disney import Disney from svtplay_dl.service.disney import Disney
from svtplay_dl.service.dplay import Dplay from svtplay_dl.service.dplay import Discoveryplus
from svtplay_dl.service.dr import Dr from svtplay_dl.service.dr import Dr
from svtplay_dl.service.efn import Efn from svtplay_dl.service.efn import Efn
from svtplay_dl.service.eurosport import Eurosport from svtplay_dl.service.eurosport import Eurosport
@ -35,7 +35,7 @@ from svtplay_dl.service.tv4play import Tv4play
from svtplay_dl.service.twitch import Twitch from svtplay_dl.service.twitch import Twitch
from svtplay_dl.service.urplay import Urplay from svtplay_dl.service.urplay import Urplay
from svtplay_dl.service.vg import Vg from svtplay_dl.service.vg import Vg
from svtplay_dl.service.viaplay import Viaplay from svtplay_dl.service.viaplay import Viafree
from svtplay_dl.service.viasatsport import Viasatsport from svtplay_dl.service.viasatsport import Viasatsport
from svtplay_dl.service.vimeo import Vimeo from svtplay_dl.service.vimeo import Vimeo
from svtplay_dl.service.youplay import Youplay from svtplay_dl.service.youplay import Youplay
@ -47,7 +47,7 @@ sites = [
Bigbrother, Bigbrother,
Cmore, Cmore,
Disney, Disney,
Dplay, Discoveryplus,
Dr, Dr,
Efn, Efn,
Eurosport, Eurosport,
@ -75,7 +75,7 @@ sites = [
Tv4, Tv4,
Tv4play, Tv4play,
Urplay, Urplay,
Viaplay, Viafree,
Viasatsport, Viasatsport,
Vimeo, Vimeo,
Vg, Vg,

View File

@ -20,7 +20,7 @@ from svtplay_dl.subtitle import subtitle
country = {".se": "sv", ".dk": "da", ".no": "no"} country = {".se": "sv", ".dk": "da", ".no": "no"}
class Viaplay(Service, OpenGraphThumbMixin): class Viafree(Service, OpenGraphThumbMixin):
supported_domains = [ supported_domains = [
"tv3play.ee", "tv3play.ee",
"tv3play.lv", "tv3play.lv",

View File

@ -419,6 +419,20 @@ def readconfig(config, configfile, service=None, preset=None):
if configdata is None: if configdata is None:
return config return config
# migrate old service name to new
old_name_in_config = False
if "service" in configdata and "dplay" in configdata["service"]:
old_name_in_config = True
logging.warning("'dplay' have been renamed to 'discoveryplus'")
configdata["service"]["discoveryplus"] = configdata["service"].pop("dplay")
if "service" in configdata and "viaplay" in configdata["service"]:
old_name_in_config = True
logging.warning("'viaplay' have been renamed to 'viafree'")
configdata["service"]["viafree"] = configdata["service"].pop("viaplay")
if old_name_in_config:
logging.warning("Old service names still work at the moment. To avoid the warnings you need to rename the service(s) to the new name(s)")
if "default" in configdata: if "default" in configdata:
config = merge(config.get_variable(), configdata["default"]) config = merge(config.get_variable(), configdata["default"])