if ARGS.resolution: w, h = ARGS.resolution.split('x') resolution = extract.Resolution(float(w), float(h)) else: resolution = None script.standardSetup(copy_db=False, file_handler=False) logging.info('****** Starting new script ********') cmd_line_files = [f.decode('utf-8') for f in ARGS.files] filepaths = movie.queryFiles(cmd_line_files) logging.debug('filepaths: %s', len(filepaths)) db.getSession().commit() logging.debug('%s files loaded', len(filepaths)) all_filters = filters.applyArgs(ARGS, db.getSession()) all_clips = [] for filepath in movie.MovieInventory(filepaths, False, all_filters): for clip in filepath.pornfile._clips: if clip.active and clip.project_id == ARGS.project_id: all_clips.append(clip) for clip in all_clips: output = os.path.join(ARGS.output_dir, '{:06d}.mp4'.format(clip.id_)) if os.path.exists(output): continue try: if resolution: mp = player.identify(clip.moviefile.getActivePath()) extract.extractClip(clip, output, resolution, mp)
parser.add_argument('--shuffle', default=True, type=util.flexibleBoolean) parser.add_argument('--extra', default='', help='extra args to pass to player') parser.add_argument('--resolution') parser.add_argument('--images', nargs='*', help='images to insert between clips') parser.add_argument('--only-blanks', action='store_true') ARGS = parser.parse_args() try: script.standardSetup(copy_db=False, file_handler=False) logging.info('****** Starting new script ********') filepaths = library.getFilePaths(ARGS) all_filters = [filters.Exists(), filters.IsMovie(), filters.ByMinCount(db.getSession(), 1), filters.ExcludeTags(['pmv', 'c**k.hero', 'compilation'])] all_filters.extend(filters.applyArgs(ARGS, db.getSession())) PROJECT = project.getProject(ARGS) inventory = movie.MovieInventory(filepaths, ARGS.shuffle, all_filters) inventory = ensureProperties(inventory) normalratings = rating.NormalRatings(db.getSession()) segment_tracker = select.getSegmentTrackerType(ARGS) #clip_type = select.getClipPickerType(ARGS, [clippicker.TargetLength(ARGS.time)]) clip_picker = clippicker.TargetLength( inventory, PROJECT, normalratings, ARGS.time, segment_tracker) girls = set() clips = []
if ARGS.resolution: w,h = ARGS.resolution.split('x') resolution = extract.Resolution(float(w), float(h)) else: resolution = None script.standardSetup(copy_db=False, file_handler=False) logging.info('****** Starting new script ********') cmd_line_files = [f.decode('utf-8') for f in ARGS.files] filepaths = movie.queryFiles(cmd_line_files) logging.debug('filepaths: %s', len(filepaths)) db.getSession().commit() logging.debug('%s files loaded', len(filepaths)) all_filters = filters.applyArgs(ARGS, db.getSession()) all_clips = [] for filepath in movie.MovieInventory(filepaths, False, all_filters): for clip in filepath.pornfile._clips: if clip.active and clip.project_id == ARGS.project_id: all_clips.append(clip) for clip in all_clips: output = os.path.join(ARGS.output_dir, '{:06d}.mp4'.format(clip.id_)) if os.path.exists(output): continue try: if resolution: mp = player.identify(clip.moviefile.getActivePath()) extract.extractClip(clip, output, resolution, mp)