althonos / althonos/InstaLooter

Why does execution (media collection) speed decrease when timeframe parameter is applied?

未关闭
#295 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug question
主要语言
Python
星标
2.1k
派生
257
PR 合并指标
30 天内没有已合并 PR

描述

## Library version

*What's the installed library version ? Check with `instalooter --version`*:

```
instalooter v2.4.3
```

## Environment

*Describe here your environment, including:*

* *Python 3.7.6*

## Error description - runtime

I found out that hashtaglooter goes through medias in a reverse chronological order; that is, collection starts from the most recent media with the target keyword used as hashtag. However, when timeframe parameter is applied, as "**for media in looter.medias(timeframe=(starttime, endtime))**", the collection speed dramatically decreases.

When I checked the collected medias, I was able to found out that the collection is not done in a reverse chronological order but rather in a random order. Therefore, I want to know why this collection order changes with the timeframe parameter and how I can keep the collection speed as fast as the no-parameter case.

### Reproducible test case

```python
looter = HashtagLooter(keyword)
time_filter = (start_time, end_time)

for media in looter.medias(timeframe = time_filter):
...
```

### Expected behaviour

I'm expecting this to have the same collection speed with "for media in looter.medias():"

### Actual behaviour

However, the run speed gets dramatically slower with the timeframe parameter being applied.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。