PK!harmonator/__init__.py__version__ = "0.1.0" PK!"мv--+harmonator/exceptions/malformed_filename.pyclass MalformedFilename(Exception): pass PK!A*((,harmonator/exceptions/malformed_filename.pyiclass MalformedFilename(Exception): ... PK!w}harmonator/filename_helpers.pyfrom datetime import datetime import re from .exceptions.malformed_filename import MalformedFilename def format_filename(episode, episode_date): return "Harmontown - S01E{} - {}.mp4".format( str(episode).zfill(3), episode_date.strftime("%Y-%m-%d") ) def parse_filename(episode_filename): if not episode_filename.startswith("Harmontown - S01E"): raise MalformedFilename() matches = re.match( r"Harmontown - S01E(\d+) - (\d+)-(\d+)-(\d+)\.mp4", episode_filename ) return ( int(matches.group(1)), datetime( int(matches.group(2)), int(matches.group(3)), int(matches.group(4)) ), ) PK!Bharmonator/filename_helpers.pyifrom datetime import datetime from typing import Tuple def format_filename(episode: int, episode_date: datetime) -> str: ... def parse_filename(episode_filename: str) -> Tuple: ... def test(a: str) -> str: ... PK!L&SSharmonator/harmonate.pyimport sys import click """ Harmonator Download Harmontown podcasts Format: Harmontown - S01E01 - 2019-01-01.mp4 """ __author__ = "Chris Read" __email__ = "centurix@gmail.com" EXIT_OK = 0 EXIT_HELP = 2 HARMONTOWN_URL = "http://download.harmontown.com/video" @click.command() @click.option("--episode", default=None, help="Episode number to download") @click.argument("destination", default=".") def download(episode, destination): """ With no specific episode 1. Scan the destination folder looking for existing HT episodes 2. Return the latest 3. Scan the download URL for newer ones 4. Download the newest one 5. Rename With a specific episode 1. Find URL's from the first known episode and count forward 2. Once the episode is found, download it 3. Rename With a date 1. Find URL's from the specific date and count forward 2. Once the episode is found, download it 3. Rename :param episode: :param destination: :return: """ return EXIT_OK if __name__ == "__main__": sys.exit(download()) # pragma: no cover PK!HnHTU harmonator-0.1.0.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]\fi4WZ^EgM_-]#0(q7PK!H7"yx#harmonator-0.1.0.dist-info/METADATAAOA +zԄ,bL`@"2۸3(ށʥi___>R/$7pBGZ< w[.վwh`}aK!QxG3R} pa#;ٟzᯅ=ͺNgXlٙi泑ia|`ʙ[ V96mQd|vFcu\|6`zk PK!HJ!harmonator-0.1.0.dist-info/RECORD9@ ,P("$)v $n߹YH,xE;Q}Y]UXܨwIyķ7GC0֤~d1Q;UX PDuXYAy&`Q;ҢQ<0y >E+ˆԊ~' 2iWڌƉ+E,Ch4 p;Ao-P"v)r"&:}PCT|^"5Ϝ%??[Xa +7I[L?M_bnξwݕ17)K׬AcRybZy^0 z~Ne)