Skip to content

Commit

Permalink
Merge pull request #296 from Guovin/master
Browse files Browse the repository at this point in the history
feat
  • Loading branch information
Guovin authored Sep 4, 2024
2 parents d918506 + c86cf79 commit 5c0aec3
Show file tree
Hide file tree
Showing 8 changed files with 2,527 additions and 42,730 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ opencc-python-reimplemented = "*"
fake-useragent = "*"
gunicorn = "*"
pillow = "*"
rapidfuzz = "*"

[requires]
python_version = "3.8"
433 changes: 321 additions & 112 deletions Pipfile.lock

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
get_ip_address,
convert_to_m3u,
get_result_file_content,
merge_objects,
)
from updates.subscribe import get_channels_by_subscribe_urls
from updates.multicast import get_channels_by_multicast
Expand All @@ -26,7 +25,8 @@
from flask import Flask, render_template_string
import sys
import shutil
from collections import defaultdict

# from collections import defaultdict

app = Flask(__name__)

Expand Down Expand Up @@ -111,14 +111,19 @@ def pbar_update(self, name=""):
)

def get_urls_len(self):
return len(
[
url
for channel_obj in self.channel_data.values()
for url_list in channel_obj.values()
for url in url_list
]
def process_cache_url(url):
if "$cache:" in url:
cache_part = url.split("$cache:", 1)[1]
return cache_part.split("?")[0]
return url

processed_urls = set(
process_cache_url(url_info[0])
for channel_obj in self.channel_data.values()
for url_info_list in channel_obj.values()
for url_info in url_info_list
)
return len(processed_urls)

async def main(self):
try:
Expand Down
Loading

0 comments on commit 5c0aec3

Please sign in to comment.