ritds / figma_backup

figma files backup util
57 stars 24 forks source link

Перестал работать full-запуск #17

Open azart opened 1 month ago

azart commented 1 month ago

Вероятно, после последнего большого обновления Figma, сломался скрипт. В логах выдается такое, комменты из предыдущих тикетов не помогают:

2024-07-19 10:45:21 Opening the login page
2024-07-19 10:45:55 Filling the email field
2024-07-19 10:45:55 Filling the password field
2024-07-19 10:45:56 Clicking the submit button
2024-07-19 10:45:56 Waiting for an after-login page opening
2024-07-19 10:46:16 Starting to process file, url: https://www.figma.com/file/mLPYMNSRT6wa5VtXwjWoZa1l2rL/
TimeoutError: Waiting for selector `[data-testid="set-tool-default"]` failed: Waiting failed: 60000ms exceeded
    at new WaitTask (/Users/aleksandr/Desktop/figma-backup/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:50:34)
    at IsolatedWorld.waitForFunction (/Users/aleksandr/Desktop/figma-backup/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Realm.js:25:26)
    at CSSQueryHandler.waitFor (/Users/aleksandr/Desktop/figma-backup/node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.js:172:95)
    at async CdpFrame.waitForSelector (/Users/aleksandr/Desktop/figma-backup/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:522:21)
    at async CdpPage.waitForSelector (/Users/aleksandr/Desktop/figma-backup/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:1305:20)
    at async downloadFile (/Users/aleksandr/Desktop/figma-backup/figma_actions.js:139:9)
    at async /Users/aleksandr/Desktop/figma-backup/figma_download_files_by_list.js:48:26
download (1/258) mLPYMNS5VtXwjWoZa1l2rL, Icons result: -7
mkartsev86 commented 1 month ago

Аналогичная проблема

Nikich1308 commented 4 weeks ago

@azart @mkartsev86 Попробуйте это

В файле figma_actions.js строка 139 (https://github.com/ritds/figma_backup/blob/master/figma_actions.js#L139) заменяем название элемента set-tool-default на любой другой существующий на странице. Например, на кнопку Share multiplayer-toolbar-share-button.

Было await page.waitForSelector('[data-testid="set-tool-default"]', {timeout: settings.pageLoadTimeout});

Стало await page.waitForSelector('[data-testid="multiplayer-toolbar-share-button"]', {timeout: settings.pageLoadTimeout});

azart commented 3 weeks ago

@Nikich1308 спасибо, попробовал. Но скачивание все-равно не идет.

Теперь ошибка такая:

2024-08-12 18:06:57 Opening the login page
2024-08-12 18:07:31 Filling the email field
2024-08-12 18:07:31 Filling the password field
2024-08-12 18:07:31 Clicking the submit button
2024-08-12 18:07:31 Waiting for an after-login page opening
2024-08-12 18:09:11 Starting to process file, url: https://www.figma.com/file/mLPYMNSRT6wa5VtXwjWoZa1l2rL/
2024-08-12 18:11:02 Tmp directory to save the file: ./process/_downloads/tmp1/
TypeError: page._client.send is not a function
    at downloadFile (/Users/aleksandr/Desktop/figma-backup/figma_actions.js:179:28)
    at async /Users/aleksandr/Desktop/figma-backup/figma_download_files_by_list.js:48:26
download (1/259) mLPYMNS5VtXwjWoZa1l2rL, Icons result: -7
Misinin commented 3 weeks ago

@azart @mkartsev86 на 189ой строчке /figma_actions.js нужно заменить div на button и все будет работать|

 ...
  const mainMenu = document.querySelector('button[data-tooltip="main-menu"]');
  ....
azart commented 3 weeks ago

@Misinin спасибо, заработало (с учетом правок от @Nikich1308 )