ritds / figma_backup Goto Github PK
View Code? Open in Web Editor NEWfigma files backup util
figma files backup util
TimeoutError: waiting for selector #fullscreen-filename
failed: timeout 30000ms exceeded
Прошу дать возможность запуска скрипта по всем командам, в которых состоит пользователь.
При большом их количестве трудоёмко вести актуальный список ID команд, по которым необходимо пройти скрипту и скачать все файлы.
1796 afterDownloadFilesNumber: 6
1797 afterDownloadFilesNumber: 6
1798 afterDownloadFilesNumber: 6
1799 afterDownloadFilesNumber: 6
File is not downloaded during timeout
Starting to process new file (10/84), key: TurjphgpqsZaqXnUy3DkEr
Opening an empty page
В чем может быть причина?
Как утечка памяти идет
При использовании скрипта сталкиваемся с ошибкой:
Traceback (most recent call last):
File "./../get_figma_files_list.py", line 8, in <module>
from yaml import load, Loader
ModuleNotFoundError: No module named 'yaml'
При этом PyYaml (6.0) установлен, через команду pip3 Install pyyaml
. Конфиги прописанны, как сказано в ридми.
@ritds, в чем может быть причина?
При повтором запуске ./manage скрипт почистил все имеющиеся файлы figma_files_list_part_*.json и начал заново.
Необходимо брать этот список и пробегаться по нему заново, иначе при большом количестве файлов Figma может забанить запросы.
Добрый день, при выполнении команды: ./manage.sh <логин> <пароль> падает в ошибку:
Python 2.7.18
node v16.13.0
settings: {
downloadTimeout: 300,
selectorTimeout: 20000,
navigationTimeout: 180000,
launchTimeout: 120000,
loginTimeout: 10000,
pageOpenTimeout: 10000
}
Opening the login page
Filling the email field
Filling the password field
Clicking the submit button
Waiting for an after-login page opening
Tmp directory to save the file: ./process/_downloads/tmp/
...
Starting to process new file (3/3), url: https://www.figma.com/file/*******************
Opening the file page: https://www.figma.com/file/*******************
Returned status: 200
Directory to save the file: ./process/_downloads/TEAM/PROJECT foo/
cannot open main menu
TimeoutError: waiting for selector div[data-testid="dropdown-option-File"]
failed: timeout 20000ms exceeded
at new WaitTask (/home/arseniy/soft/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:528:34)
at DOMWorld.waitForSelectorInPage (/home/arseniy/soft/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:432:26)
at Object.internalHandler.waitFor (/home/arseniy/soft/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:31:77)
at DOMWorld.waitForSelector (/home/arseniy/soft/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:323:29)
at Frame.waitForSelector (/home/arseniy/soft/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:936:51)
at Page.waitForSelector (/home/arseniy/soft/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2359:33)
at /home/arseniy/soft/figma_backup-master/download_figma_files.js:278:49
DONE
Пробовал увеличить timeout не помогает
При запуске ./manage.sh в nohup файл не исполняется.
nohup.txt пустой, а в бэкграунде не видно не одной задачи.
OS: Ubuntu
Opening the login page
Filling the email field
Filling the password field
Clicking the submit button
Waiting for an after-login page opening
cp: ./_downloads/*: No such file or directory
При скачивании некоторых файлов получаем ошибку:
Starting to process new file (6/100), key: FILE_KEY
Opening an empty page
Opening the file page: https://www.figma.com/file/FILE_KEY/
Returned status: 200
Page title: FILE_TITLE
Directory to save the file: './_downloads/TEAM NAME/PROJECT NAME/'
Using menu to save the file
TypeError: Cannot read property 'boundingBox' of null
at /home/USER/figma-backup/download_figma_files.js:245:69
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
При этом сам файл сохраняется, получится ли открыть, скоро проверим
В инструкции написано что проверял на python2, а по дефолту в get_figma_files.py стоит python3 :), ну сменил я на python2, и ничего в итоге не работает, в том файле функции третьего питона, возврат на питон3 не решает все остальные ошибки, какую версию puppeteer'а использовать тоже не написано, та которая скачивается при npm i не работает, ошибка таймаут, версии старше 14.3.0 выдают ошибку
at downloadFile (/home/egor/Downloads/figma_backup-master/figma_actions.js:179:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /home/egor/Downloads/figma_backup-master/figma_download_files_by_list.js:48:26
download (1/1) Uv9r2wWUqwi71EHjNeyGoS, Untitled result: -7
Версии ниже выдают ошибку
Error: Evaluation failed: TypeError: Cannot read properties of null (reading 'dispatchEvent')
at pptr://__puppeteer_evaluation_script__:5:22
at ExecutionContext._evaluateInternal (/home/egor/Downloads/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (/home/egor/Downloads/figma_backup-master/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async downloadFile (/home/egor/Downloads/figma_backup-master/figma_actions.js:188:9)
at async /home/egor/Downloads/figma_backup-master/figma_download_files_by_list.js:48:26
download (1/1) Uv9r2wWUqwi71EHjNeyGoS, Untitled result: -7
В общем если у кого-то этот скрипт работает, скиньте пожалуйста вывод node -v и npm list, и каким образом вы сетапитесь, инструкцию нужно обновить.
Вероятно, после последнего большого обновления 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
Сегодня скрипт перестал скачивать файлы из фигмы. Доступы есть, токены валидные, смена пользователя результата не дала, в дебаг-папке актуальные скрины и валидный html. Однако любой файл валится с ошибкой вот такого вида:
Starting to process new file (1/493), url: https://www.figma.com/file/file_uuid/
Opening the file page: https://www.figma.com/file/file_uuid/
Returned status: 200
Directory to save the file: ./process/_downloads/MyProject/
Error: Evaluation failed: TypeError: Cannot read properties of null (reading 'dispatchEvent')
at puppeteer_evaluation_script:5:26
at ExecutionContext._evaluateInternal (../tool/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ExecutionContext.evaluate (../tool/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async ../tool/download_figma_files.js:267:13
Проблемы начались сегодня ночью. По исходникам выглядит, как будто скрипт пытается вызвать dispatchEvent на отсутствующем html-элементе, но почему так - вопрос, ибо такой div в верстке на странице присутствует.
Если есть идеи, как этому можно помочь - буду очень благодарен!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.