conv2mp4-py.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:conv2mp4-py 作者: Kameecoding 项目源码 文件源码
def add_targets(self):

        self.target_dir = os.path.dirname(self.input_video)
        self.hard_link = ''

        if MOVE_FILES:
            #If we care about foreign languages execute this part
            if FOREIGN:
                audiostreams = self.get_audio_streams()
                #if we want to create hard links and there is both english and locale audio stream in the file or in the name
                if HARD_LINK and ((LOCALE in audiostreams and 'eng' in audiostreams) or (re.search('.{}.'.format(LOCALE),self.input_video,re.I) and re.search('.eng.',self.input_video,re.I))):
                    self.target_dir = TVSHOW_TARGET if self.is_show else MOVIE_TARGET
                    self.hard_link = LANG_TVSHOW_TARGET if self.is_show else LANG_MOVIE_TARGET          
                else:
                    #If the the input is matches LOCALE put it in the lang folders
                    if re.search(LANG_PATTERN,self.input_video,re.I | re.M):
                        self.target_dir = LANG_TVSHOW_TARGET if self.is_show else LANG_MOVIE_TARGET
                    #Else put them in the main folder
                    else:
                        self.target_dir = TVSHOW_TARGET if self.is_show else MOVIE_TARGET
            #if we don't give a shit about multiple languages simply determine if tvshow or movie
            else:
                self.target_dir = TVSHOW_TARGET if self.is_show else MOVIE_TARGET
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号