Example #1
0
def main():
    parser = argparse.ArgumentParser(
        description=
        'Encode a season of existing podcasts to mkv and upload them to YouTube.'
    )
    parser.add_argument('--version',
                        action='version',
                        version=podpublish.__version__)
    parser.add_argument('filename',
                        type=argparse.FileType('r'),
                        help="Podcast configuration file.")
    args = parser.parse_args()

    AUDIO_FORMAT = 'mp3'

    config = configuration.Configuration(args.filename)
    audio_files = get_files(config.audio_in, AUDIO_FORMAT)

    comment_suffix = config.tags['comments']

    for audio_file in audio_files:
        # Ignore the low bitrate files
        if '_low' in audio_file:
            continue

        # Pull in the episode from the audio filename.
        config.episode = re.findall(r"(?:e|x|episode|\n)(\d{2})", audio_file,
                                    re.I)[0]
        config.update_filename()

        # Update the configuration to point at the current audio file.
        config.audio_in = audio_file
        tags = get_tags(audio_file, AUDIO_FORMAT)

        # Pull in the title from the audio tags.
        config.tags['title'] = tags['title'][0]
        config.tags['comments'] = tags['title'][0] + comment_suffix
        config.youtube['description'] = tags['title'][0] + comment_suffix

        if not os.path.isfile(config.mkv_file):
            encoder.png_poster(config)
            encoder.mkv_encode(config)
            os.remove(config.png_poster_file)

        if not os.path.isfile(config.mkv_file + '.upload'):
            uploader.youtube_upload(config)
            touch(config.mkv_file + '.upload')
Example #2
0
def main():
    parser = argparse.ArgumentParser(description='Encode a season of existing podcasts to mkv and upload them to YouTube.')
    parser.add_argument('--version', action='version', version=podpublish.__version__)
    parser.add_argument('filename', type=argparse.FileType('r'), help="Podcast configuration file.")
    args = parser.parse_args()

    AUDIO_FORMAT='mp3'

    config = configuration.Configuration(args.filename)
    audio_files = get_files(config.audio_in, AUDIO_FORMAT)

    comment_suffix = config.tags['comments']

    for audio_file in audio_files:
        # Ignore the low bitrate files
        if '_low' in audio_file:
            continue

        # Pull in the episode from the audio filename.
        config.episode = re.findall(r"(?:e|x|episode|\n)(\d{2})", audio_file, re.I)[0]
        config.update_filename()

        # Update the configuration to point at the current audio file.
        config.audio_in = audio_file
        tags = get_tags(audio_file, AUDIO_FORMAT)

        # Pull in the title from the audio tags.
        config.tags['title'] = tags['title'][0]
        config.tags['comments'] = tags['title'][0] + comment_suffix
        config.youtube['description'] = tags['title'][0] + comment_suffix

        if not os.path.isfile(config.mkv_file):
            encoder.png_poster(config)
            encoder.mkv_encode(config)
            os.remove(config.png_poster_file)

        if not os.path.isfile(config.mkv_file + '.upload'):
            uploader.youtube_upload(config)
            touch(config.mkv_file + '.upload')
Example #3
0
def main():
    parser = argparse.ArgumentParser(description='Encode a podcast to mp3, ogg and mkv.')
    parser.add_argument('--version', action='version', version=podpublish.__version__)
    parser.add_argument('filename', type=argparse.FileType('r'), help="Podcast configuration file.")
    args = parser.parse_args()

    config = configuration.Configuration(args.filename)
    if not config.skip_mp3:
        encoder.audio_encode(config, 'mp3')
        encoder.mp3_tag(config)
        encoder.mp3_coverart(config)

    if not config.skip_ogg:
        encoder.audio_encode(config, 'ogg')
        encoder.ogg_tag(config)
        encoder.ogg_coverart(config)

    encoder.png_header(config)
    encoder.png_poster(config)

    if not config.skip_youtube:
        encoder.mkv_encode(config)