Compare commits

...

28 commits

Author SHA1 Message Date
Pawarit Thong-ek 6b110e8342
Merge 783967571e into d6c4b9f6b3 2024-09-19 22:20:16 +03:00
Taras Terletsky d6c4b9f6b3
Merge pull request #363 from tropicoo/dependabot/pip/sqlalchemy-2.0.35
Bump sqlalchemy from 2.0.34 to 2.0.35
2024-09-18 23:57:54 +03:00
Taras Terletsky 188f35db9b
Merge pull request #364 from tropicoo/dependabot/pip/pydantic-2.9.2
Bump pydantic from 2.9.1 to 2.9.2
2024-09-18 23:57:47 +03:00
Taras Terletsky d38ba4d300
Merge pull request #365 from tropicoo/dependabot/pip/fastapi-standart--0.115.0
Bump fastapi[standart] from 0.114.1 to 0.115.0
2024-09-18 23:57:38 +03:00
Taras Terletsky b5c752e3b9
Merge pull request #361 from tropicoo/dependabot/pip/pyrofork-2.3.46
Bump pyrofork from 2.3.45 to 2.3.46
2024-09-18 23:57:30 +03:00
dependabot[bot] b08d65e4b6
Bump fastapi[standart] from 0.114.1 to 0.115.0
Bumps [fastapi[standart]](https://github.com/fastapi/fastapi) from 0.114.1 to 0.115.0.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.114.1...0.115.0)

---
updated-dependencies:
- dependency-name: fastapi[standart]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-18 15:14:34 +00:00
dependabot[bot] be35cbff34
Bump pydantic from 2.9.1 to 2.9.2
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.1 to 2.9.2.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.1...v2.9.2)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-18 15:14:29 +00:00
dependabot[bot] 1ca7f678bb
Bump sqlalchemy from 2.0.34 to 2.0.35
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.34 to 2.0.35.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-17 15:40:11 +00:00
dependabot[bot] 8c1517de91
Bump pyrofork from 2.3.45 to 2.3.46
Bumps [pyrofork](https://github.com/Mayuri-Chan/pyrofork) from 2.3.45 to 2.3.46.
- [Release notes](https://github.com/Mayuri-Chan/pyrofork/releases)
- [Commits](https://github.com/Mayuri-Chan/pyrofork/compare/v2.3.45...v2.3.46)

---
updated-dependencies:
- dependency-name: pyrofork
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-13 15:55:00 +00:00
Taras Terletsky 79e33fbee6
Merge pull request #359 from tropicoo/dependabot/pip/fastapi-standart--0.114.1
Bump fastapi[standart] from 0.114.0 to 0.114.1
2024-09-12 20:38:07 +03:00
Taras Terletsky 17c1f0561c
Merge pull request #360 from tropicoo/dependabot/pip/pydantic-settings-2.5.2
Bump pydantic-settings from 2.4.0 to 2.5.2
2024-09-12 20:37:58 +03:00
dependabot[bot] 0a7de0eb25
Bump pydantic-settings from 2.4.0 to 2.5.2
Bumps [pydantic-settings](https://github.com/pydantic/pydantic-settings) from 2.4.0 to 2.5.2.
- [Release notes](https://github.com/pydantic/pydantic-settings/releases)
- [Commits](https://github.com/pydantic/pydantic-settings/compare/v2.4.0...v2.5.2)

---
updated-dependencies:
- dependency-name: pydantic-settings
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-11 15:31:53 +00:00
dependabot[bot] 62d3691e8d
Bump fastapi[standart] from 0.114.0 to 0.114.1
Bumps [fastapi[standart]](https://github.com/fastapi/fastapi) from 0.114.0 to 0.114.1.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.114.0...0.114.1)

---
updated-dependencies:
- dependency-name: fastapi[standart]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-11 15:31:46 +00:00
Taras Terletsky a00bb92cd5
Merge pull request #357 from tropicoo/dependabot/pip/fastapi-standart--0.114.0
Bump fastapi[standart] from 0.113.0 to 0.114.0
2024-09-10 00:52:58 +03:00
Taras Terletsky 5928f310be
Merge pull request #356 from tropicoo/dependabot/pip/pyrofork-2.3.45
Bump pyrofork from 2.3.44 to 2.3.45
2024-09-10 00:52:52 +03:00
Taras Terletsky dc9e2c35de
Merge pull request #355 from tropicoo/dependabot/pip/pydantic-2.9.1
Bump pydantic from 2.9.0 to 2.9.1
2024-09-10 00:52:45 +03:00
dependabot[bot] f7090e7bed
Bump fastapi[standart] from 0.113.0 to 0.114.0
Bumps [fastapi[standart]](https://github.com/fastapi/fastapi) from 0.113.0 to 0.114.0.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.113.0...0.114.0)

---
updated-dependencies:
- dependency-name: fastapi[standart]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 15:47:49 +00:00
dependabot[bot] 280079403c
Bump pyrofork from 2.3.44 to 2.3.45
Bumps [pyrofork](https://github.com/Mayuri-Chan/pyrofork) from 2.3.44 to 2.3.45.
- [Release notes](https://github.com/Mayuri-Chan/pyrofork/releases)
- [Commits](https://github.com/Mayuri-Chan/pyrofork/compare/v2.3.44...v2.3.45)

---
updated-dependencies:
- dependency-name: pyrofork
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 15:47:42 +00:00
dependabot[bot] 1272169b25
Bump pydantic from 2.9.0 to 2.9.1
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 15:47:38 +00:00
Taras Terletsky 245b08bc23
Merge pull request #353 from tropicoo/dependabot/pip/fastapi-standart--0.113.0
Bump fastapi[standart] from 0.112.2 to 0.113.0
2024-09-06 23:25:34 +03:00
Taras Terletsky d0acdd6303
Merge pull request #351 from tropicoo/dependabot/pip/sqlalchemy-2.0.34
Bump sqlalchemy from 2.0.32 to 2.0.34
2024-09-06 23:25:27 +03:00
Taras Terletsky 1aa1e5f8fe
Merge pull request #354 from tropicoo/dependabot/pip/pydantic-2.9.0
Bump pydantic from 2.8.2 to 2.9.0
2024-09-06 23:25:14 +03:00
Taras Terletsky c38ca70de8
Merge pull request #350 from tropicoo/dependabot/pip/pyrofork-2.3.44
Bump pyrofork from 2.3.43 to 2.3.44
2024-09-06 23:25:03 +03:00
dependabot[bot] ac707b3e28
Bump pydantic from 2.8.2 to 2.9.0
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.8.2 to 2.9.0.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.8.2...v2.9.0)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 15:05:16 +00:00
dependabot[bot] 790b4f7a58
Bump fastapi[standart] from 0.112.2 to 0.113.0
Bumps [fastapi[standart]](https://github.com/fastapi/fastapi) from 0.112.2 to 0.113.0.
- [Release notes](https://github.com/fastapi/fastapi/releases)
- [Commits](https://github.com/fastapi/fastapi/compare/0.112.2...0.113.0)

---
updated-dependencies:
- dependency-name: fastapi[standart]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 15:05:12 +00:00
dependabot[bot] 4d906002ec
Bump sqlalchemy from 2.0.32 to 2.0.34
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 2.0.32 to 2.0.34.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-04 15:43:22 +00:00
dependabot[bot] ac5baeb0f9
Bump pyrofork from 2.3.43 to 2.3.44
Bumps [pyrofork](https://github.com/Mayuri-Chan/pyrofork) from 2.3.43 to 2.3.44.
- [Release notes](https://github.com/Mayuri-Chan/pyrofork/releases)
- [Commits](https://github.com/Mayuri-Chan/pyrofork/compare/v2.3.43...v2.3.44)

---
updated-dependencies:
- dependency-name: pyrofork
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-03 15:42:19 +00:00
Pawarit Thongaek 783967571e feat: create task payload add custom_options 2024-05-08 22:33:48 +07:00
9 changed files with 23 additions and 7 deletions

View file

@ -175,7 +175,13 @@ documentations lives at `http://127.0.0.1:1984/docs`.
"download_media_type": "AUDIO_VIDEO",
"save_to_storage": false,
"custom_filename": "cool.mp4",
"automatic_extension": false
"automatic_extension": false,
"custom_options": {
"http_headers": {
"User-Agent": "MyApp/1.0.0",
"Authorization": "Bearer <token>"
}
}
}
```
Response

View file

@ -59,7 +59,7 @@ class CreateTaskIn(StrictRealBaseModel):
save_to_storage: bool = ...
custom_filename: str = ...
automatic_extension: bool = ...
custom_options: dict | None = Field(None, strict=False)
class CreateTaskOut(StrictRealBaseModel):
id: uuid.UUID

View file

@ -81,6 +81,7 @@ class TaskService:
ack_message_id=None,
custom_filename=task.custom_filename,
automatic_extension=task.automatic_extension,
custom_options=task.custom_options,
)
if not await publisher.send_for_download(payload):
raise TaskServiceError('Failed to create task')

View file

@ -1,2 +1,2 @@
fastapi-cache2[redis]==0.2.2
fastapi[standart]==0.112.2
fastapi[standart]==0.115.0

View file

@ -37,6 +37,7 @@ class UrlService:
download_media_type=url.download_media_type,
custom_filename=None,
automatic_extension=False,
custom_options=None,
)
is_sent = await self._rmq_publisher.send_for_download(payload)
if not is_sent:

View file

@ -1,4 +1,4 @@
PyYAML==6.0.2
pyrofork==2.3.43
pyrofork==2.3.46
tenacity==9.0.0
TgCrypto-pyrofork @ git+https://github.com/Mayuri-Chan/tgcrypto-pyrofork

View file

@ -60,6 +60,13 @@ class MediaDownloader:
media_type=media_type, curr_tmp_dir=curr_tmp_dir
)
if media_payload.custom_options:
for key, value in media_payload.custom_options.items():
try:
ytdl_opts_model.ytdl_opts[key].update(value)
except KeyError:
ytdl_opts_model.ytdl_opts[key] = value
with yt_dlp.YoutubeDL(ytdl_opts_model.ytdl_opts) as ytdl:
self._log.info('Downloading "%s" to "%s"', url, curr_tmp_dir)
self._log.info(

View file

@ -1,9 +1,9 @@
SQLAlchemy-Utils==0.41.2
SQLAlchemy==2.0.32
SQLAlchemy==2.0.35
aio-pika==9.4.3
aiohttp==3.10.5
asyncpg==0.29.0
pillow==10.4.0
pydantic==2.8.2
pydantic_settings==2.4.0
pydantic==2.9.2
pydantic_settings==2.5.2
uvloop==0.20.0

View file

@ -37,6 +37,7 @@ class InbMediaPayload(StrictRealBaseModel):
download_media_type: DownMediaType
custom_filename: str | None
automatic_extension: bool
custom_options: dict[str, dict] | None
added_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))