These last days the algorithm seems to not treat completely firstly the starting set of channels before treating discovered channels #51

Closed
opened 2023-02-20 18:45:47 +01:00 by Benjamin_Loison · 1 comment

Used to remove channels not in the starting set:

removeChannelsNotInStartingSet.py:

#!/usr/bin/python3

import os

with open('newChannels.txt') as f:
    lines = f.read().splitlines()

startingSet = set(lines)

os.chdir('channels/')

for element in os.listdir():
    if not element.startswith('UC'):
        continue
    print(element)
    channel = None
    if element.endswith('.zip'):
        channel = element.replace('.zip', '')
    if not channel in startingSet:
        os.remove(element)
        print(f'{element} removed!')
Used to remove channels not in the starting set: `removeChannelsNotInStartingSet.py`: ```py #!/usr/bin/python3 import os with open('newChannels.txt') as f: lines = f.read().splitlines() startingSet = set(lines) os.chdir('channels/') for element in os.listdir(): if not element.startswith('UC'): continue print(element) channel = None if element.endswith('.zip'): channel = element.replace('.zip', '') if not channel in startingSet: os.remove(element) print(f'{element} removed!') ```
Benjamin_Loison added the
quick
bug
high priority
labels 2023-02-20 18:45:47 +01:00
Author
Owner
21-02-2023 13-21-59.513: 3: Treating channel UCYne4N06sHVhRBXS0Lq5D8g (treated: 56, to treat: 57)
21-02-2023 13-42-01.397: 7: Treating channel UCmz7q3pgPQIS2HOdJTv5eOg (treated: 57, to treat: 56)

While UCYne4N06sHVhRBXS0Lq5D8g is in the starting set, UCmz7q3pgPQIS2HOdJTv5eOg isn't. What a coincidence (ironic) that the problem raises when treated and to treat meet.

This problem may be linked to the fact that the to treat counter doesn't increase as expected.

As channels are written to channels.txt we don't need to restart from scratch the execution of the algorithm, we are just treating channels in an unknown order.

``` 21-02-2023 13-21-59.513: 3: Treating channel UCYne4N06sHVhRBXS0Lq5D8g (treated: 56, to treat: 57) 21-02-2023 13-42-01.397: 7: Treating channel UCmz7q3pgPQIS2HOdJTv5eOg (treated: 57, to treat: 56) ``` While `UCYne4N06sHVhRBXS0Lq5D8g` is in the starting set, `UCmz7q3pgPQIS2HOdJTv5eOg` isn't. What a coincidence (*ironic*) that the problem raises when `treated` and `to treat` meet. This problem may be linked to the fact that the `to treat` counter doesn't increase as expected. As channels are written to `channels.txt` we don't need to restart from scratch the execution of the algorithm, we are just treating channels in an unknown order.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/YouTube_captions_search_engine#51
No description provided.