funread 1.0.3__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. funread-1.1.2/PKG-INFO +20 -0
  2. funread-1.1.2/pyproject.toml +7 -0
  3. funread-1.1.2/setup.cfg +4 -0
  4. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/download/generate.py +29 -9
  5. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/download/rss.py +37 -5
  6. funread-1.1.2/src/funread.egg-info/PKG-INFO +20 -0
  7. funread-1.1.2/src/funread.egg-info/SOURCES.txt +27 -0
  8. funread-1.1.2/src/funread.egg-info/dependency_links.txt +1 -0
  9. funread-1.1.2/src/funread.egg-info/requires.txt +3 -0
  10. funread-1.1.2/src/funread.egg-info/top_level.txt +1 -0
  11. funread-1.0.3/PKG-INFO +0 -27
  12. funread-1.0.3/pyproject.toml +0 -18
  13. {funread-1.0.3 → funread-1.1.2}/LICENSE +0 -0
  14. {funread-1.0.3 → funread-1.1.2}/README.md +0 -0
  15. {funread-1.0.3 → funread-1.1.2}/src/funread/__init__.py +0 -0
  16. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/__init__.py +0 -0
  17. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/__init__.py +0 -0
  18. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/download/__init__.py +0 -0
  19. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/download/base.py +0 -0
  20. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/download/book.py +0 -0
  21. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/utils/__init__.py +0 -0
  22. {funread-1.0.3 → funread-1.1.2}/src/funread/legado/manage/utils/core.py +0 -0
  23. {funread-1.0.3 → funread-1.1.2}/src/funread/scripts/__init__.py +0 -0
  24. {funread-1.0.3 → funread-1.1.2}/src/funread/scripts/command.py +0 -0
  25. {funread-1.0.3 → funread-1.1.2}/src/funread/web/__init__.py +0 -0
  26. {funread-1.0.3 → funread-1.1.2}/src/funread/web/page/__init__.py +0 -0
  27. {funread-1.0.3 → funread-1.1.2}/src/funread/web/page/video.py +0 -0
  28. {funread-1.0.3 → funread-1.1.2}/src/funread/web/page/video_list.py +0 -0
  29. {funread-1.0.3 → funread-1.1.2}/src/funread/web/parse/__init__.py +0 -0
  30. {funread-1.0.3 → funread-1.1.2}/src/funread/web/parse/base.py +0 -0
  31. {funread-1.0.3 → funread-1.1.2}/src/funread/web/parse/video.py +0 -0
funread-1.1.2/PKG-INFO ADDED
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.1
2
+ Name: funread
3
+ Version: 1.1.2
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: dominate>=2.9.1
9
+ Requires-Dist: funfile>=1.0.11
10
+ Requires-Dist: funutil>=1.0.25
11
+
12
+ # 阅读
13
+
14
+ [源仓库](http://www.yckceo1.com/)
15
+
16
+ [规则说明](https://alanskycn.gitee.io/teachme/)
17
+
18
+ [app端](https://github.com/gedoor/legado)
19
+
20
+ [服务端](https://github.com/hectorqin/reader)
@@ -0,0 +1,7 @@
1
+ [project]
2
+ name = "funread"
3
+ version = "1.1.2"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.8"
7
+ dependencies = [ "dominate>=2.9.1", "funfile>=1.0.11", "funutil>=1.0.25",]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,11 +1,14 @@
1
+ import os.path
1
2
  from datetime import datetime
2
3
 
3
4
  from dominate.tags import *
4
5
  from fundrive import GithubDrive
5
6
  from funfile import funos
6
- from funread.legado.manage.download.rss import RSSSourceDownload
7
7
  from funsecret import read_secret
8
8
  from funtask import Task
9
+ from tqdm import tqdm
10
+
11
+ from funread.legado.manage.download.rss import RSSSourceDownload
9
12
 
10
13
  """
11
14
  dominate example: https://blog.csdn.net/wumingxiaoyao/article/details/122894671
@@ -29,12 +32,18 @@ class GenerateCommon:
29
32
  self.generate_build_repo("fundrive", "farfarfun/fundrive")
30
33
  self.generate_build_repo("funread", "farfarfun/funread")
31
34
  with li("订阅源:"):
32
- a("github",
33
- href="yuedu://rssSource/importonline?src=https://github.com/farfarfun/funread-cache/raw/master/funread/legado/rss/rss-main.json")
34
- a("gitee",
35
- href="yuedu://rssSource/importonline?src=https://gitee.com/farfarfun/funread-cache/raw/master/funread/legado/rss/rss-main.json")
36
- a("gitlink",
37
- href="yuedu://rssSource/importonline?src=https://gitlink.org.cn/farfarfun/funread-cache/raw/master/funread/legado/rss/rss-main.json")
35
+ a(
36
+ "github",
37
+ href="yuedu://rssSource/importonline?src=https://github.com/farfarfun/funread-cache/raw/master/funread/legado/rss/rss-main.json",
38
+ )
39
+ a(
40
+ "gitee",
41
+ href="yuedu://rssSource/importonline?src=https://gitee.com/farfarfun/funread-cache/raw/master/funread/legado/rss/rss-main.json",
42
+ )
43
+ a(
44
+ "gitlink",
45
+ href="yuedu://rssSource/importonline?src=https://gitlink.org.cn/farfarfun/funread-cache/raw/master/funread/legado/rss/rss-main.json",
46
+ )
38
47
 
39
48
  def generate(self):
40
49
  br()
@@ -150,7 +159,18 @@ class GenerateSourceType:
150
159
  return html_root.render()
151
160
 
152
161
  def split_and_upload(self):
153
- path = read_secret(cate1='funread', cate2='cache', cate3='path', cate4='root')
162
+ path = read_secret(cate1="funread", cate2="cache", cate3="path", cate4="root")
163
+ with RSSSourceDownload(path=path, cate1="rss") as runner:
164
+ runner.loads_zip()
165
+ runner.rss_download()
166
+ for file in tqdm(os.listdir(path)):
167
+ filepath = os.path.join(path, file)
168
+ try:
169
+ runner.add_sources(open(filepath, "r").read())
170
+ except Exception as e:
171
+ print(e)
172
+ runner.dumps_zip()
173
+
154
174
  with RSSSourceDownload(path=path, cate1="rss") as runner:
155
175
  funos.delete(runner.path_pkl)
156
176
  funos.delete(runner.path_bok)
@@ -168,7 +188,7 @@ class GenerateSourceType:
168
188
 
169
189
 
170
190
  class GenerateSourceTask(Task):
171
- def __init__(self, dir_path=f"funread/legado/snapshot/lasted", source_type="booksource", *args, **kwargs):
191
+ def __init__(self, dir_path="funread/legado/snapshot/lasted", source_type="booksource", *args, **kwargs):
172
192
  self.repo_str = "farfarfun/funread-cache"
173
193
  self.dir_path = dir_path
174
194
  self.source_type = source_type
@@ -1,6 +1,15 @@
1
+ import json
2
+ import os
1
3
  import re
2
4
 
5
+ import requests
6
+ from funfile import funos
3
7
  from funread.legado.manage.download.base import DownloadSource
8
+ from funsecret import get_md5_str
9
+ from funutil import getLogger
10
+ from tqdm import tqdm
11
+
12
+ logger = getLogger("funread")
4
13
 
5
14
 
6
15
  def retain_zh_ch_dig(text):
@@ -21,16 +30,15 @@ class RSSSourceFormat:
21
30
  def run(self):
22
31
  keys = [key for key in self.source.keys() if not self.source[key]]
23
32
  for key in keys:
24
-
25
33
  self.source.pop(key)
26
34
 
27
- for key in ['customOrder', 'respondTime', 'lastUpdateTime']:
35
+ for key in ["customOrder", "respondTime", "lastUpdateTime"]:
28
36
  if key in self.source.keys():
29
37
  self.source.pop(key)
30
38
 
31
- for key in ['searchUrl', 'exploreUrl']:
39
+ for key in ["searchUrl", "exploreUrl"]:
32
40
  if key in self.source.keys():
33
- self.source[key] = self.source[key].replace(self.source['bookSourceUrl'], '')
41
+ self.source[key] = self.source[key].replace(self.source["bookSourceUrl"], "")
34
42
  return self.source
35
43
 
36
44
  def __format_base(self, group, map):
@@ -53,4 +61,28 @@ class RSSSourceDownload(DownloadSource):
53
61
  def source_format(self, source):
54
62
  return RSSSourceFormat(source).run()
55
63
 
56
-
64
+ def rss_download(self):
65
+ urls = [
66
+ "https://jt12.de/SYV2_4/2024/03/04/20/48/54/170955653465e5c33680046.json",
67
+ "https://jt12.de/SYV2/2023/03/17/0/02/42/167898256264133da2869d4.json",
68
+ "https://agit.ai/butterfly/yd/raw/branch/yd/迷迭订阅源.json",
69
+ ]
70
+ size = len(urls)
71
+ for uri in ("https://www.yckceo.com",):
72
+ for _id in tqdm(range(0, 50), desc=uri):
73
+ urls.append(f"{uri}/yuedu/rsss/json/id/{_id}.json")
74
+ for _id in tqdm(range(0, 500), desc=uri):
75
+ urls.append(f"{uri}/yuedu/rss/json/id/{_id}.json")
76
+
77
+ cache_path = f"{self.path_rot}/../cache"
78
+ funos.makedirs(cache_path)
79
+ for index, url in tqdm(enumerate(urls), total=len(urls)):
80
+ file = f"{cache_path}/{get_md5_str(url)}.json"
81
+ if index > size and os.path.exists(file):
82
+ continue
83
+ try:
84
+ data = json.dumps(requests.get(url).json())
85
+ with open(file, "w") as fw:
86
+ fw.write(data)
87
+ except Exception as e:
88
+ logger.error(f"Failed to download {url}: {e}")
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.1
2
+ Name: funread
3
+ Version: 1.1.2
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: dominate>=2.9.1
9
+ Requires-Dist: funfile>=1.0.11
10
+ Requires-Dist: funutil>=1.0.25
11
+
12
+ # 阅读
13
+
14
+ [源仓库](http://www.yckceo1.com/)
15
+
16
+ [规则说明](https://alanskycn.gitee.io/teachme/)
17
+
18
+ [app端](https://github.com/gedoor/legado)
19
+
20
+ [服务端](https://github.com/hectorqin/reader)
@@ -0,0 +1,27 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/funread/__init__.py
5
+ src/funread.egg-info/PKG-INFO
6
+ src/funread.egg-info/SOURCES.txt
7
+ src/funread.egg-info/dependency_links.txt
8
+ src/funread.egg-info/requires.txt
9
+ src/funread.egg-info/top_level.txt
10
+ src/funread/legado/__init__.py
11
+ src/funread/legado/manage/__init__.py
12
+ src/funread/legado/manage/download/__init__.py
13
+ src/funread/legado/manage/download/base.py
14
+ src/funread/legado/manage/download/book.py
15
+ src/funread/legado/manage/download/generate.py
16
+ src/funread/legado/manage/download/rss.py
17
+ src/funread/legado/manage/utils/__init__.py
18
+ src/funread/legado/manage/utils/core.py
19
+ src/funread/scripts/__init__.py
20
+ src/funread/scripts/command.py
21
+ src/funread/web/__init__.py
22
+ src/funread/web/page/__init__.py
23
+ src/funread/web/page/video.py
24
+ src/funread/web/page/video_list.py
25
+ src/funread/web/parse/__init__.py
26
+ src/funread/web/parse/base.py
27
+ src/funread/web/parse/video.py
@@ -0,0 +1,3 @@
1
+ dominate>=2.9.1
2
+ funfile>=1.0.11
3
+ funutil>=1.0.25
@@ -0,0 +1 @@
1
+ funread
funread-1.0.3/PKG-INFO DELETED
@@ -1,27 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: funread
3
- Version: 1.0.3
4
- Summary:
5
- Author: farfun
6
- Author-email: 1007530194@qq.com
7
- Requires-Python: >=3.8,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Requires-Dist: dominate (>=2.9.1,<3.0.0)
15
- Requires-Dist: funfile (>=1.0.3,<2.0.0)
16
- Description-Content-Type: text/markdown
17
-
18
- # 阅读
19
-
20
- [源仓库](http://www.yckceo1.com/)
21
-
22
- [规则说明](https://alanskycn.gitee.io/teachme/)
23
-
24
- [app端](https://github.com/gedoor/legado)
25
-
26
- [服务端](https://github.com/hectorqin/reader)
27
-
@@ -1,18 +0,0 @@
1
- [build-system]
2
- requires = [ "poetry-core",]
3
- build-backend = "poetry.core.masonry.api"
4
-
5
- [tool.poetry]
6
- name = "funread"
7
- version = "1.0.3"
8
- description = ""
9
- authors = [ "farfun <1007530194@qq.com>",]
10
- readme = "README.md"
11
- [[tool.poetry.packages]]
12
- from = "src"
13
- include = "*"
14
-
15
- [tool.poetry.dependencies]
16
- python = "^3.8"
17
- dominate = "^2.9.1"
18
- funfile = "^1.0.3"
File without changes
File without changes
File without changes