Johnserf-Seed / f2

High-speed downloader for multiple platforms
https://johnserf-seed.github.io/f2/
Apache License 2.0
313 stars 61 forks source link

[BUG] table user_info_web has no column named nickname_raw #86

Closed az56789aa closed 2 months ago

az56789aa commented 2 months ago

同樣的配置在複製過後創造新的配置時卻無下載,有嘗試過直接元配置更換URL但還是會顯示相同錯誤,但是URL是可以正確的位址 下載的網址是 url : https://www.douyin.com/user/MS4wLjABAAAATsq4y-_SnvhIcJ6HGGB01qSgC2mhcMQYBtIystrIeMw?vid=7329091887095106851

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ in _run_module_as_main:198 │ │ in _run_code:88 │ │ │ │ in :7 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py:1157 in │ │ call │ │ │ │ 1154 │ │ │ 1155 │ def call(self, *args: t.Any, kwargs: t.Any) -> t.Any: │ │ 1156 │ │ """Alias for :meth:main.""" │ │ ❱ 1157 │ │ return self.main(*args, kwargs) │ │ 1158 │ │ 1159 │ │ 1160 class Command(BaseCommand): │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py:1078 in │ │ main │ │ │ │ 1075 │ │ try: │ │ 1076 │ │ │ try: │ │ 1077 │ │ │ │ with self.make_context(prog_name, args, extra) as ctx: │ │ ❱ 1078 │ │ │ │ │ rv = self.invoke(ctx) │ │ 1079 │ │ │ │ │ if not standalone_mode: │ │ 1080 │ │ │ │ │ │ return rv │ │ 1081 │ │ │ │ │ # it's not safe to ctx.exit(rv) here! │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py:1688 in │ │ invoke │ │ │ │ 1685 │ │ │ │ super().invoke(ctx) │ │ 1686 │ │ │ │ sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) │ │ 1687 │ │ │ │ with sub_ctx: │ │ ❱ 1688 │ │ │ │ │ return _process_result(sub_ctx.command.invoke(sub_ctx)) │ │ 1689 │ │ │ │ 1690 │ │ # In chain mode we create the contexts step by step, but after the │ │ 1691 │ │ # base command has been invoked. Because at that point we do not │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py:1434 in │ │ invoke │ │ │ │ 1431 │ │ │ echo(style(message, fg="red"), err=True) │ │ 1432 │ │ │ │ 1433 │ │ if self.callback is not None: │ │ ❱ 1434 │ │ │ return ctx.invoke(self.callback, *ctx.params) │ │ 1435 │ │ │ 1436 │ def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]: │ │ 1437 │ │ """Return a list of completions for the incomplete value. Looks │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py:783 in │ │ invoke │ │ │ │ 780 │ │ │ │ 781 │ │ with augment_usage_errors(self): │ │ 782 │ │ │ with ctx: │ │ ❱ 783 │ │ │ │ return callback(args, kwargs) │ │ 784 │ │ │ 785 │ def forward( │ │ 786 │ │ self, cmd: "Command", *args: t.Any, kwargs: t.Any # noqa: B902 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\decorators.py:33 │ │ in new_func │ │ │ │ 30 │ """ │ │ 31 │ │ │ 32 │ def new_func(*args: "P.args", *kwargs: "P.kwargs") -> "R": │ │ ❱ 33 │ │ return f(get_current_context(), args, kwargs) │ │ 34 │ │ │ 35 │ return update_wrapper(new_func, f) │ │ 36 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\apps\douyin\cli.py:44 │ │ 3 in douyin │ │ │ │ 440 │ │ │ 441 │ # 添加app_name到kwargs │ │ 442 │ kwargs["app_name"] = "douyin" │ │ ❱ 443 │ ctx.invoke(set_cli_config, kwargs) │ │ 444 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py:783 in │ │ invoke │ │ │ │ 780 │ │ │ │ 781 │ │ with augment_usage_errors(self): │ │ 782 │ │ │ with ctx: │ │ ❱ 783 │ │ │ │ return callback(*args, *kwargs) │ │ 784 │ │ │ 785 │ def forward( │ │ 786 │ │ self, cmd: "Command", args: t.Any, kwargs: t.Any # noqa: B902 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\decorators.py:33 │ │ in new_func │ │ │ │ 30 │ """ │ │ 31 │ │ │ 32 │ def new_func(*args: "P.args", kwargs: "P.kwargs") -> "R": │ │ ❱ 33 │ │ return f(get_current_context(), args, **kwargs) │ │ 34 │ │ │ 35 │ return update_wrapper(new_func, f) │ │ 36 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\cli\cli_commands.py:1 │ │ 35 in set_cli_config │ │ │ │ 132 │ │ │ 133 │ with RichConsoleManager().progress: │ │ 134 │ │ try: │ │ ❱ 135 │ │ │ asyncio.run(run_app(kwargs)) │ │ 136 │ │ except APIError as e: │ │ 137 │ │ │ logger.error(e) │ │ 138 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py:190 in run │ │ │ │ 187 │ │ │ "asyncio.run() cannot be called from a running event loop") │ │ 188 │ │ │ 189 │ with Runner(debug=debug) as runner: │ │ ❱ 190 │ │ return runner.run(main) │ │ 191 │ │ 192 │ │ 193 def _cancel_all_tasks(loop): │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py:118 in run │ │ │ │ 115 │ │ │ │ 116 │ │ self._interrupt_count = 0 │ │ 117 │ │ try: │ │ ❱ 118 │ │ │ return self._loop.run_until_complete(task) │ │ 119 │ │ except exceptions.CancelledError: │ │ 120 │ │ │ if self._interrupt_count > 0: │ │ 121 │ │ │ │ uncancel = getattr(task, "uncancel", None) │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py:653 in │ │ run_until_complete │ │ │ │ 650 │ │ if not future.done(): │ │ 651 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │ │ 652 │ │ │ │ ❱ 653 │ │ return future.result() │ │ 654 │ │ │ 655 │ def stop(self): │ │ 656 │ │ """Stop running the event loop. │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\cli\cli_commands.py:1 │ │ 44 in run_app │ │ │ │ 141 │ logger.info(f"Version {f2.version}") │ │ 142 │ app_name = kwargs["app_name"] │ │ 143 │ app_module = importlib.import_module(f"f2.apps.{app_name}.handler") │ │ ❱ 144 │ await app_module.main(kwargs) │ │ 145 │ │ 146 │ │ 147 if name == "main": │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\apps\douyin\handler.p │ │ y:1484 in main │ │ │ │ 1481 async def main(kwargs): │ │ 1482 │ mode = kwargs.get("mode") │ │ 1483 │ if mode in mode_function_map: │ │ ❱ 1484 │ │ await mode_functionmapmode │ │ 1485 │ else: │ │ 1486 │ │ logger.error(("不存在该模式: {0}").format(mode)) │ │ 1487 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\apps\douyin\handler.p │ │ y:257 in handle_user_post │ │ │ │ 254 │ │ # 获取用户数据并返回创建用户目录 │ │ 255 │ │ sec_user_id = await SecUserIdFetcher.get_sec_user_id(self.kwargs.get("url")) │ │ 256 │ │ async with AsyncUserDB("douyin_users.db") as udb: │ │ ❱ 257 │ │ │ user_path = await self.get_or_add_user_data(self.kwargs, sec_user_id, udb) │ │ 258 │ │ │ │ 259 │ │ async for aweme_data_list in self.fetch_user_post_videos( │ │ 260 │ │ │ sec_user_id, max_cursor, page_counts, max_counts │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\apps\douyin\handler.p │ │ y:151 in get_or_add_user_data │ │ │ │ 148 │ │ │ │ 149 │ │ # 如果用户不在数据库中,将其添加到数据库 │ │ 150 │ │ if not local_user_data: │ │ ❱ 151 │ │ │ await db.add_user_info(**current_user_data._to_dict()) │ │ 152 │ │ │ │ 153 │ │ return user_path │ │ 154 │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\apps\douyin\db.py:74 │ │ in add_user_info │ │ │ │ 71 │ │ placeholders = ", ".join(["?"] len(kwargs)) │ │ 72 │ │ values = tuple(kwargs.values()) │ │ 73 │ │ │ │ ❱ 74 │ │ await self.execute( │ │ 75 │ │ │ f"INSERT OR REPLACE INTO {self.TABLE_NAME} ({keys}) VALUES ({placeholders})" │ │ 76 │ │ │ values, │ │ 77 │ │ ) │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\f2\db\base_db.py:55 in │ │ execute │ │ │ │ 52 │ │ """ │ │ 53 │ │ cursor = await self.conn.cursor() │ │ 54 │ │ if parameters: │ │ ❱ 55 │ │ │ await cursor.execute(query, parameters) │ │ 56 │ │ else: │ │ 57 │ │ │ await cursor.execute(query) │ │ 58 │ │ return cursor │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiosqlite\cursor.py:48 │ │ in execute │ │ │ │ 45 │ │ """Execute the given query.""" │ │ 46 │ │ if parameters is None: │ │ 47 │ │ │ parameters = [] │ │ ❱ 48 │ │ await self._execute(self._cursor.execute, sql, parameters) │ │ 49 │ │ return self │ │ 50 │ │ │ 51 │ async def executemany( │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiosqlite\cursor.py:40 │ │ in _execute │ │ │ │ 37 │ │ │ 38 │ async def _execute(self, fn, *args, *kwargs): │ │ 39 │ │ """Execute the given function on the shared connection's thread.""" │ │ ❱ 40 │ │ return await self._conn._execute(fn, args, kwargs) │ │ 41 │ │ │ 42 │ async def execute( │ │ 43 │ │ self, sql: str, parameters: Optional[Iterable[Any]] = None │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiosqlite\core.py:133 in │ │ _execute │ │ │ │ 130 │ │ │ │ 131 │ │ self._tx.put_nowait((future, function)) │ │ 132 │ │ │ │ ❱ 133 │ │ return await future │ │ 134 │ │ │ 135 │ async def _connect(self) -> "Connection": │ │ 136 │ │ """Connect to the actual sqlite database.""" │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiosqlite\core.py:106 in │ │ run │ │ │ │ 103 │ │ │ │ break │ │ 104 │ │ │ try: │ │ 105 │ │ │ │ LOG.debug("executing %s", function) │ │ ❱ 106 │ │ │ │ result = function() │ │ 107 │ │ │ │ LOG.debug("operation %s completed", function) │ │ 108 │ │ │ │ │ │ 109 │ │ │ │ def set_result(fut, result): │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ OperationalError: table user_info_web has no column named nickname_raw

Johnserf-Seed commented 2 months ago

image

az56789aa commented 2 months ago

請問刪除舊的數據庫文件是指什麼文件刪除呢?原本下載的檔案嗎?還是只yaml文件還是指什麼文件呢?

Johnserf-Seed commented 2 months ago

請問刪除舊的數據庫文件是指什麼文件刪除呢?原本下載的檔案嗎?還是只yaml文件還是指什麼文件呢?

*.db的为数据库文件