Browse Source

Fix a relativate path problem

master
wchen342 3 years ago
parent
commit
3ca7b7e106
Signed by: wchen342 GPG Key ID: 720B70365E800508
  1. 6
      bilibili.py
  2. 6
      bilibili_search.py

6
bilibili.py

@ -91,7 +91,7 @@ class Bilibili:
os.chdir(output_dir)
# Download, merge
func = functools.partial(self.process_single, url, output_dir, p_num)
func = functools.partial(self.process_single, url, '.', p_num)
ret, res = utils.retry_wrapper(func, max_retry=self.max_retry)
# Get out of tmp folder
@ -183,8 +183,8 @@ class Bilibili:
print(''.join(f.readlines()))
stream = ffmpeg.input(tmp_file, format='concat', safe=0)
stream = ffmpeg.output(stream, os.path.join(self.output_dir,
self.prepare_output_filename(res, p_num) + os.path.extsep + 'mp4'),
stream = ffmpeg.output(stream,
os.path.join('..', self.prepare_output_filename(res, p_num) + os.path.extsep + 'mp4'),
c='copy')
if self.debug:
print(ffmpeg.compile(stream, overwrite_output=True))

6
bilibili_search.py

@ -208,7 +208,7 @@ class SubPageSearch(object):
warning("Empty queue")
continue
retry_wrapper(functools.partial(self._sub_page_exec, item), max_retry=5, timeout=3)
retry_wrapper(functools.partial(self._sub_page_exec, item), max_retry=5, timeout=5)
def _sub_page_exec(self, item):
v_link = item['link']
@ -289,10 +289,6 @@ if __name__ == "__main__":
queue = mg.Queue()
dict_out = mg.dict()
# for k in url_dict.keys():
# url_dict[k]['status'] = IN_PROCESS
# pool.apply_async(single_url_wrapper, args=(mode, k, params, url_dict[k]),
# error_callback=on_error, callback=on_success)
pool.apply_async(search_main, args=(headless, queue, lock, main_status,), error_callback=error_handler)
# search_main(queue)

Loading…
Cancel
Save