def update_gopal_2018(dry_run=False): repo = GopalVishvAsa2018RepoBase(repo_paths=[ os.path.join( "/home/vvasuki/veda-audio/jaiminIya-sAma-paravastu", "jaiminIya-sAma-gAna-paravastu-tradition-anuvachanam-gopAla-vishvAsa" ) ], git_remote_origin_basepath= "[email protected]:veda-audio") logging.info(pprint.pformat(repo.reprocess(dry_run=dry_run))) archive_audio_item = None archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=NormalizedFilesRepo.archive_id) # archive_audio_item.update_metadata(metadata=NormalizedFilesRepo.metadata) normalized_files_repo = audio_repo.NormalizedRepo( base_repo=repo, archive_audio_item=archive_audio_item) logging.info( pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run))) archive_audio_item = None archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=SpeedFileRepo.archive_id) # archive_audio_item.update_metadata(metadata=SpeedFilesRepo.metadata) speed_files_repo = SpeedFileRepo(base_repo=normalized_files_repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(speed_files_repo.reprocess(dry_run=dry_run)))
def update_repo(dry_run=False): repo = RepoBase(repo_paths=[os.path.join("/home/vvasuki/kAvya-audio/durgA-saptashatI")]) archive_audio_item = archive_utility.ArchiveAudioItem(archive_id=NormalizedFilesRepo.archive_id) archive_audio_item.update_metadata(metadata=NormalizedFilesRepo.metadata) logging.info(pprint.pformat(repo.reprocess(dry_run=dry_run))) normalized_files_repo = audio_repo.NormalizedRepo(base_repo=repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run)))
def update_rAmAnuja_1974(dry_run=False): repo = RamanujaRepoBase(repo_paths=[ os.path.join("/home/vvasuki/veda-audio/jaiminIya-sAma-paravastu", "jaiminIya-sAma-gAna-paravastu-tradition-rAmAnuja") ]) archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=NormalizedFilesRepo.archive_id) normalized_files_repo = audio_repo.NormalizedRepo( base_repo=repo, archive_audio_item=archive_audio_item) logging.info( pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run)))
def upload_volume(title, repo_paths, author, reader, episode_data=None, archive_id=None, dry_run=False, gmusic_client=None, description=None): repo = RepoBase(title=title, author=author, reader=reader, episode_data=episode_data, repo_paths=repo_paths, git_remote_origin_basepath="[email protected]:kannada-audio") logging.info(pprint.pformat(repo.reprocess(dry_run=dry_run))) if archive_id is None: archive_id = re.sub("[^a-zA-Z]+", "-", title) archive_id = re.sub("^[^a-zA-Z]+", "", archive_id) archive_audio_item = None if (not dry_run): archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=archive_id, config_file_path="/home/vvasuki/kannada-audio/ia_nagu.config") metadata = { "title": title, "description": description if (description is not None) else """ {} Audio book recorded by volunteers. भवद्योगदानं काङ्क्ष्यते - https://sanskrit.github.io/groups/dyuganga/projects/audio/kannada-audio/index.html """.format(author) } archive_audio_item.update_metadata(metadata=metadata) normalized_files_repo = audio_repo.NormalizedRepo( base_repo=repo, archive_audio_item=archive_audio_item, derivative_namer=audio_repo.title_based_file_namer) logging.info( pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run))) archive_id = archive_id + "-1.5x" if (not dry_run): archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=archive_id, config_file_path="/home/vvasuki/kannada-audio/ia_nagu.config") metadata["description"] = metadata["description"] + "\n\n 1.5x speed" archive_audio_item.update_metadata(metadata=metadata) speed_file_repo = audio_repo.SpeedFileRepo( base_repo=normalized_files_repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(speed_file_repo.reprocess(dry_run=dry_run)))
def update_repo(dry_run=False): repo = RepoBase(repo_paths=[ "/home/vvasuki/Music/git-curation/shAstra-audio/sthAneshvara-tantra-sAra-parichayaH/" ]) archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=NormalizedFilesRepo.archive_id) # archive_audio_item.update_metadata(metadata=NormalizedFilesRepo.metadata) logging.info(pprint.pformat(repo.reprocess(dry_run=dry_run))) normalized_files_repo = audio_repo.NormalizedRepo( base_repo=repo, archive_audio_item=archive_audio_item) logging.info( pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run)))
def upload_volume(title, repo_paths, dry_run=False, gmusic_client=None, description=None): repo = RepoBase(title=title, repo_paths=repo_paths, git_remote_origin_basepath="[email protected]:kannada-audio") logging.info( pprint.pformat( repo.regenerate_derivatives(files=repo.get_files(), dry_run=dry_run))) logging.info(pprint.pformat(repo.reprocess(dry_run=dry_run))) archive_id = re.sub("[^a-zA-Z]+", "-", title) archive_id = re.sub("^[^a-zA-Z]+", "", archive_id) archive_audio_item = None if (not dry_run): archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=archive_id, config_file_path="/home/vvasuki/kannada-audio/ia_nagu.config") metadata = { "title": title, "description": description if (description is not None) else """ DV Gundappa ಡಿ ವಿ ಗುಂಡಪ್ಪ/ ಡಿ ವಿ ಜಿ - ಜ್ಞಾಪಕಚಿತ್ರಶಾಲೆ Free Audio book. भवद्योगदानं काङ्क्ष्यते - https://sanskrit.github.io/groups/dyuganga/projects/audio/kannada-audio/index.html """ } archive_audio_item.update_metadata(metadata=metadata) normalized_files_repo = audio_repo.NormalizedRepo( base_repo=repo, archive_audio_item=archive_audio_item, derivative_namer=audio_repo.title_based_file_namer) logging.info( pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run))) archive_id = archive_id + "-1.5x" if (not dry_run): archive_audio_item = archive_utility.ArchiveAudioItem( archive_id=archive_id, config_file_path="/home/vvasuki/kannada-audio/ia_nagu.config") metadata["description"] = metadata["description"] + "\n\n 1.5x speed" archive_audio_item.update_metadata(metadata=metadata) speed_file_repo = audio_repo.SpeedFileRepo( base_repo=normalized_files_repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(speed_file_repo.reprocess(dry_run=dry_run)))
def update_gopal_2015(dry_run=False): repo = Gopal2015RepoBase(repo_paths=[os.path.join("/home/vvasuki/veda-audio/jaiminIya-sAma-paravastu", "jaiminIya-sAma-gAna-paravastu-tradition-gopAla-2015")]) archive_audio_item = archive_utility.ArchiveAudioItem(archive_id=NormalizedFilesRepo.archive_id) archive_audio_item.update_metadata(metadata=NormalizedFilesRepo.metadata) normalized_files_repo = audio_repo.NormalizedRepo(base_repo=repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run)))
for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) logging.basicConfig( level=logging.DEBUG, format="%(levelname)s:%(asctime)s:%(module)s:%(lineno)d %(message)s") dry_run = False base_repo = mbh_audio.MbhRepoBase( repo_paths=mbh_audio.repo_paths, git_remote_origin_basepath="[email protected]:mahabharata-audio-2018") # base_repo.update_metadata(mp3_files=[Mp3File(file_path=file) for file in base_repo.base_mp3_file_paths]) # exit() logging.info(pprint.pformat(base_repo.reprocess(dry_run=dry_run))) archive_id = "mahAbhArata-mUla-paThanam-GP" archive_audio_item = archive_utility.ArchiveAudioItem(archive_id=archive_id) # [archive_audio_item.update_mp3_metadata(mp3_file=file) for file in glob.glob("/home/vvasuki/mahabharata-audio-2018/parva01-001-100/normalized_mp3/*.mp3")] # exit() normalized_files_repo = audio_repo.NormalizedRepo( base_repo=base_repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(normalized_files_repo.reprocess(dry_run=dry_run))) archive_id = "mahAbhArata-mUla-paThanam-GP-150p-speed" archive_audio_item = archive_utility.ArchiveAudioItem(archive_id=archive_id) # archive_audio_item.update_metadata(metadata=mbh_audio.SpeedFileRepo.metadata) # [archive_audio_item.update_mp3_metadata(mp3_file=file) for file in glob.glob("/home/vvasuki/mahabharata-audio-2018/parva01-001-100/speed_mp3/*.mp3")] # exit() speed_files_repo = mbh_audio.SpeedFileRepo( base_repo=normalized_files_repo, archive_audio_item=archive_audio_item) logging.info(pprint.pformat(speed_files_repo.reprocess(dry_run=dry_run)))