dev #19

Merged
profitroll merged 98 commits from dev into master 2023-04-24 13:48:22 +03:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 6e8b47cf4b - Show all commits

View File

@ -49,6 +49,7 @@
"move_sent": false, "move_sent": false,
"use_interval": false, "use_interval": false,
"interval": "1h30m", "interval": "1h30m",
"page_size": 300,
"submitted_caption": { "submitted_caption": {
"enabled": true, "enabled": true,
"ignore_admins": true, "ignore_admins": true,

View File

@ -41,11 +41,11 @@ async def random_pic(token: Union[str, None] = None) -> Tuple[str, str]:
* `Tuple[str, str]`: First value is an ID and the filename in the filesystem to be indexed. * `Tuple[str, str]`: First value is an ID and the filename in the filesystem to be indexed.
""" """
token = await authorize() if token is None else token token = await authorize() if token is None else token
logWrite(f'{configGet("address", "posting", "api")}/albums/{configGet("album", "posting", "api")}/photos?q=&page_size=500&caption=queue') logWrite(f'{configGet("address", "posting", "api")}/albums/{configGet("album", "posting", "api")}/photos?q=&page_size={configGet("page_size", "posting")}&caption=queue')
resp = get(f'{configGet("address", "posting", "api")}/albums/{configGet("album", "posting", "api")}/photos?q=&page_size=500&caption=queue', headers={"Authorization": f"Bearer {token}"}) resp = get(f'{configGet("address", "posting", "api")}/albums/{configGet("album", "posting", "api")}/photos?q=&page_size={configGet("page_size", "posting")}&caption=queue', headers={"Authorization": f"Bearer {token}"})
if resp.status_code != 200: if resp.status_code != 200:
logWrite(f'Could not get photos from album {configGet("album", "posting", "api")}: HTTP {resp.status_code}') logWrite(f'Could not get photos from album {configGet("album", "posting", "api")}: HTTP {resp.status_code}')
logWrite(f'Could not get photos from "{configGet("address", "posting", "api")}/albums/{configGet("album", "posting", "api")}/photos?q=&page_size=500&caption=queue" using token "{token}": HTTP {resp.status_code}', debug=True) logWrite(f'Could not get photos from "{configGet("address", "posting", "api")}/albums/{configGet("album", "posting", "api")}/photos?q=&page_size={configGet("page_size", "posting")}&caption=queue" using token "{token}": HTTP {resp.status_code}', debug=True)
raise ValueError raise ValueError
if len(resp.json()["results"]) == 0: if len(resp.json()["results"]) == 0:
raise KeyError raise KeyError