6212 Тихонов Никита Леонидович Лаб.2 Вар.22#533
Closed
NikitaTikhonov321 wants to merge 1 commit intoitsecd:mainfrom
Closed
6212 Тихонов Никита Леонидович Лаб.2 Вар.22#533NikitaTikhonov321 wants to merge 1 commit intoitsecd:mainfrom
NikitaTikhonov321 wants to merge 1 commit intoitsecd:mainfrom
Conversation
IlyaOv
requested changes
Mar 23, 2026
| files = [] | ||
| soup = parse_html_content() | ||
| extracted = extract_mp3_urls_from_html(soup) | ||
| mkdir_path = Path("downloaded_mp3") |
There was a problem hiding this comment.
Захардкожена директория для сохранения. Аргумент "directory" при запуске скрипта вообще не используется, получается.
Author
There was a problem hiding this comment.
mkdir_path = Path(directory)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ФИО: Тихонов Никита Леонидович
Номер группы: 6212
Номер лабораторной: 2
Номер варианта: 22
Краткое описание решаемой задачи: Согласно варианту 22 лабораторной 2 мне надо было скачать музыку в жанре pop. Составить аннотацию в виде csv-файла, в котором будет абсолютный и относительный путь к каждому файлу.
Написать итератор по путям к файлам - используя в качестве параметра конструктора файл-аннотации или путь к папке.
Краткое описание работы кода: Модуль lab2_var22.py является точкой входа в приложение для парсинга веб-страницы и загрузки аудиофайлов. Программа получает HTML-содержимое сайта mixkit.co, извлекает из него ссылки на MP3-файлы с помощью регулярных выражений, загружает их и сохраняет в локальную директорию. Затем формирует CSV-файл со списком загруженных файлов (имя, относительный и абсолютный пути). Также реализован итератор AudioFileIterator, который позволяет обходить аудиофайлы как из директории, так и из CSV-файла. Чтобы запустить приложение, требуется указать аргументы командной строки:
python lab2_var22.py -c out.csv -d downloaded_mp3