示例#1
0
# Every argument to this script is treated as a path to a release to be uploaded
release_list = files.get_paths(args.file_list)

if len(release_list) == 0:
    logging.critical('You must give this script at least one file or directory to process!')
    sys.exit(1)

for path in release_list:

    # Log exceptions but don't raise them; just continue

    try:

        if isinstance(path, bytes):
            path = path.decode('utf-8')
        files.set_log_file_name(os.path.basename(path) + '.log')
        upload = uploads.Upload(
            path=path,
            tracker=tracker,
            imdb_link=args.imdb,
            take_screenshots=args.take_screens,
            num_screenshots=args.num_screenshots,
            delete_unwanted_files=args.delete_unwanted_files,
        )

        logging.info('------------------------------------------------------------')
        logging.info(upload.release.name)
        logging.info('------------------------------------------------------------')

        upload.start(
            dry_run=args.dry_run,
示例#2
0
release_list = files.get_paths(args.file_list)

if len(release_list) == 0:
    logging.critical(
        'You must give this script at least one file or directory to process!')
    sys.exit(1)

for path in release_list:

    # Log exceptions but don't raise them; just continue

    try:

        if isinstance(path, bytes):
            path = path.decode('utf-8')
        files.set_log_file_name(os.path.basename(path) + '.log')
        upload = uploads.Upload(
            path=path,
            tracker=tracker,
            imdb_link=args.imdb,
            take_screenshots=args.take_screens,
            num_screenshots=args.num_screenshots,
            delete_unwanted_files=args.delete_unwanted_files,
        )

        logging.info(
            '------------------------------------------------------------')
        logging.info(upload.release.name)
        logging.info(
            '------------------------------------------------------------')
示例#3
0
Takes screenshots of a set of video files, and uploads them to an image host.
"""

from __future__ import print_function, unicode_literals, division, absolute_import

import logging
import argparse
import os

import files
import image_hosts
import config

image_host = image_hosts.ImageBam

files.set_log_file_name('screenshots.log')

# Set up the argument parser
parser = argparse.ArgumentParser(description='Takes screenshots of one or more video files, '
                                             'and uploads them to an image host.')
parser.add_argument(
    'file_list',
    type=str,
    metavar='video-file',
    nargs='+',
    help='file or directory containing the release'
)
parser.add_argument(
    '-n',
    '--num-screenshots',
    type=int,
示例#4
0
"""
Takes screenshots of a set of video files, and uploads them to an image host.
"""

from __future__ import print_function, unicode_literals, division, absolute_import
import logging
import argparse
import os

import files
import image_hosts
import config

image_host = image_hosts.ImageBam

files.set_log_file_name('screenshots.log')

# Set up the argument parser
parser = argparse.ArgumentParser(
    description='Takes screenshots of one or more video files, '
    'and uploads them to an image host.')
parser.add_argument('file_list',
                    type=bytes,
                    metavar='video-file',
                    nargs='+',
                    help='file or directory containing the release')
parser.add_argument('-n',
                    '--num-screenshots',
                    type=int,
                    metavar='<number>',
                    dest='num_screenshots',