github-heatmap 1.2.7__tar.gz → 1.2.8__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.
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/PKG-INFO +1 -1
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/weread_loader.py +29 -15
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap.egg-info/PKG-INFO +1 -1
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/setup.py +1 -1
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/LICENSE +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/README.md +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/__init__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/__main__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/circluar_drawer.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/cli.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/config.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/drawer.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/err.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/html_parser/__init__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/html_parser/github_parser.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/html_parser/gitlab_parser.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/html_parser/jike_parse.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/html_parser/kindle_parser.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/__init__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/apple_health_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/base_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/bbdc_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/bilibili_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/chatgpt_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/cichang_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/config.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/covid_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/dota2_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/duolingo_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/forest_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/from_github_issue_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/garmin_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/github_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/gitlab_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/gpx_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/jike_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/json_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/kindle_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/leetcode_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/multiple_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/neodb_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/notion_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/nrc_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/ns_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/openlanguage_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/shanbay_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/strava_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/summary_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/todoist_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/wakatime_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/youtube_loader.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/poster.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/skyline/__init__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/skyline/config.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/skyline/font/__init__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/skyline/skyline.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/structures.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/utils.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap.egg-info/SOURCES.txt +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap.egg-info/dependency_links.txt +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap.egg-info/entry_points.txt +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap.egg-info/requires.txt +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap.egg-info/top_level.txt +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/pyproject.toml +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/setup.cfg +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/tests/__init__.py +0 -0
- {github_heatmap-1.2.7 → github_heatmap-1.2.8}/tests/test_poster_utils.py +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import pendulum
|
|
2
3
|
import requests
|
|
3
4
|
import os
|
|
@@ -5,7 +6,17 @@ import os
|
|
|
5
6
|
from github_heatmap.loader.base_loader import BaseLoader
|
|
6
7
|
from github_heatmap.loader.config import WEREAD_BASE_URL, WEREAD_HISTORY_URL
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
headers = {
|
|
10
|
+
'User-Agent': "WeRead/8.2.5 WRBrand/xiaomi Dalvik/2.1.0 (Linux; U; Android 12; Redmi Note 7 Pro Build/SQ3A.220705.004)",
|
|
11
|
+
'Connection': "Keep-Alive",
|
|
12
|
+
'Accept-Encoding': "gzip",
|
|
13
|
+
'baseapi': "32",
|
|
14
|
+
'appver': "8.2.5.10163885",
|
|
15
|
+
'osver': "12",
|
|
16
|
+
'channelId': "11",
|
|
17
|
+
'basever': "8.2.5.10163885",
|
|
18
|
+
'Content-Type': "application/json; charset=UTF-8"
|
|
19
|
+
}
|
|
9
20
|
class WereadLoader(BaseLoader):
|
|
10
21
|
track_color = "#2EA8F7"
|
|
11
22
|
unit = "mins"
|
|
@@ -13,9 +24,9 @@ class WereadLoader(BaseLoader):
|
|
|
13
24
|
def __init__(self, from_year, to_year, _type, **kwargs):
|
|
14
25
|
super().__init__(from_year, to_year, _type)
|
|
15
26
|
self.weread_cookie = kwargs.get("weread_cookie", "")
|
|
16
|
-
if not self.weread_cookie:
|
|
17
|
-
self.weread_cookie = self.get_cookie()
|
|
18
27
|
self.session = requests.Session()
|
|
28
|
+
self.session.headers = headers
|
|
29
|
+
self.refresh_token()
|
|
19
30
|
self._make_years_list()
|
|
20
31
|
|
|
21
32
|
@classmethod
|
|
@@ -28,18 +39,21 @@ class WereadLoader(BaseLoader):
|
|
|
28
39
|
help="",
|
|
29
40
|
)
|
|
30
41
|
|
|
31
|
-
def
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
def refresh_token(self):
|
|
43
|
+
weread = json.loads(os.getenv("WEREAD"))
|
|
44
|
+
body = {"deviceId": weread.get("generatedDeviceId"), "refreshToken": weread.get("refreshToken")}
|
|
45
|
+
r = self.session.post(
|
|
46
|
+
"https://api.notionhub.app/refresh-weread-token", json=body
|
|
47
|
+
)
|
|
48
|
+
if r.ok:
|
|
49
|
+
response_data = r.json()
|
|
50
|
+
vid = response_data.get("vid")
|
|
51
|
+
accessToken = response_data.get("accessToken")
|
|
52
|
+
if vid and accessToken:
|
|
53
|
+
self.session.headers.update({"vid": str(vid), "accessToken": accessToken})
|
|
54
|
+
else:
|
|
55
|
+
print("Failed to refresh token")
|
|
56
|
+
|
|
43
57
|
|
|
44
58
|
def try_get_cloud_cookie(self,url, id, password):
|
|
45
59
|
if url.endswith("/"):
|
|
@@ -6,7 +6,7 @@ setup(
|
|
|
6
6
|
author_email="linkang.ma@gmail.com",
|
|
7
7
|
url="https://github.com/malinkang/GitHubPoster",
|
|
8
8
|
license="MIT",
|
|
9
|
-
version="1.2.
|
|
9
|
+
version="1.2.8",
|
|
10
10
|
description="Make everything a GitHub svg poster and Skyline!",
|
|
11
11
|
packages=find_packages(),
|
|
12
12
|
include_package_data=True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_heatmap-1.2.7 → github_heatmap-1.2.8}/github_heatmap/loader/from_github_issue_loader.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|