Пример #1
0
 def test_sublang(self):
     config = setup_defaults()
     config.set("output", os.path.join(os.path.dirname(os.path.realpath(__file__)), "postprocess/textfile-service"))
     service = Service(config, "http://exmaple.com")
     service.output["title"] = "textfile"
     stream = VideoRetriever(config, "http://example.com", 0, output=service.output)
     assert _sublanguage(stream, config, None) == ["swe"]
Пример #2
0
 def test_sublang3(self, req):
     config = setup_defaults()
     self.setup_mock(req, "smj")
     config.set("output", os.path.join(os.path.dirname(os.path.realpath(__file__)), "postprocess/textfile-service"))
     config.set("get_all_subtitles", True)
     service = Service(config, "http://exmaple.com")
     service.output["title"] = "textfile"
     stream = VideoRetriever(config, "http://example.com", 0, output=service.output)
     self.assertEqual(_sublanguage(stream, config, ["lulesamiska"]), ["smj"])
Пример #3
0
 def test_formatnameTvshowPath(self):
     config = setup_defaults()
     if platform.system() == "Windows":
         config.set("path", "c:")
     else:
         config.set("path", "/tmp")
     service = Service(config, "http://localhost")
     service.output["title"] = "kalle"
     service.output["season"] = 2
     service.output["episode"] = 2
     if platform.system() == "Windows":
         assert formatname(service.output, config) == r"c:kalle.s02e02-service.mp4"
     else:
         assert formatname(service.output, config) == "/tmp/kalle.s02e02-service.mp4"
Пример #4
0
 def test_formatname(self):
     for item in self.all_combo:
         config = setup_defaults()
         config.set("filename", item[0])
         service = Service(config, "localhost")
         service.output.update(item[1])
         assert _formatname(service.output, config, "mp4") == item[2]
Пример #5
0
 def test_formatnameOutput(self):
     config = setup_defaults()
     config.set("output", "/tmp")
     service = Service(config, "http://localhost")
     if platform.system() == "Windows":
         assert formatname(service.output, config) == "/tmp.mp4"
     else:
         assert formatname(service.output, config) == "/tmp/-service.mp4"
Пример #6
0
 def test_formatnameTvshow(self):
     config = setup_defaults()
     service = Service(config, "http://localhost")
     service.output["tvshow"] = True
     service.output["title"] = "kalle"
     service.output["season"] = 2
     service.output["episode"] = 2
     assert formatname(service.output, config) == "kalle.s02e02-service.mp4"
Пример #7
0
 def test_formatnameTvshowSubfolderMovie(self):
     config = setup_defaults()
     config.set("subfolder", True)
     service = Service(config, "http://localhost")
     service.output["tvshow"] = False
     service.output["title"] = "kalle"
     service.output["season"] = 2
     service.output["episode"] = 2
     if platform.system() == "Windows":
         assert formatname(service.output, config) == r"movies\kalle.s02e02-service.mp4"
     else:
         assert formatname(service.output, config) == "movies/kalle.s02e02-service.mp4"
Пример #8
0
 def __init__(self, url):
     Service.__init__(self, url)
     self.subtitle = None
Пример #9
0
 def __init__(self, url):
     Service.__init__(self, url)
     self.subtitle = None
     self.cookies = {}
Пример #10
0
 def __init__(self, url):
     Service.__init__(self, url)
     self.subtitle = None
Пример #11
0
 def __init__(self, config, _url, http=None):
     Service.__init__(self, config, _url, http)
     self._data = None
Пример #12
0
 def __init__(self, url):
     Service.__init__(self, url)
     self.cj = CookieJar()
     self.subtitle = None
Пример #13
0
 def __init__(self, url):
     Service.__init__(self, url)
     self.cj = CookieJar()
     self.subtitle = None
Пример #14
0
 def test_formatnameBasedir(self):
     config = setup_defaults()
     service = Service(config, "http://localhost")
     service.output["basedir"] = True
     assert formatname(service.output, config) == "-service.mp4"
Пример #15
0
 def test_formatnameEmpty(self):
     config = setup_defaults()
     service = Service(config, "http://localhost")
     assert formatname(service.output, config) == "-service.mp4"