-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v2.0.2 release - Automatic update checking and notification to the user - Fix known bugs
- Loading branch information
Showing
15 changed files
with
155 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
CONTRIBUTORS INFO | ||
https://github.com/Thisal-D@%@Thisal Dilmith | ||
https://github.com/childeyouyu@%@youyu | ||
https://github.com/Navindu21@%@Navindu Pahasara | ||
https://github.com/sooryasuraweera@%@Soorya Suraweera | ||
https://github.com/sooryasuraweera@%@Soorya Suraweera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
"reload_automatically": false, | ||
"update_delay": 0.5, | ||
"window_geometry": "900x500+0+0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"name": "PyTube Downloader", | ||
"site": "https://github.com/Thisal-D/PyTube-Downloader", | ||
"version": "2.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from urllib import request | ||
import requests | ||
from typing import List, Dict | ||
from .json_utility import JsonUtility | ||
|
||
|
||
class DataRetriveUtility: | ||
CONTRIBUTORS_TEXT_URL = "https://raw.githubusercontent.com/Thisal-D/PyTube-Downloader/main/contributors.txt" | ||
VERSION_FILE_URL = "https://raw.githubusercontent.com/Thisal-D/PyTube-Downloader/main/VERSION" | ||
|
||
@staticmethod | ||
def get_contributors_data() -> List[Dict]: | ||
""" | ||
Retrieve contributors data from a GitHub repository. | ||
Returns: | ||
list: A list of dictionaries containing contributor information. | ||
""" | ||
contributors = [] | ||
try: | ||
data = requests.get(DataRetriveUtility.CONTRIBUTORS_TEXT_URL).text | ||
for contributor_data in data.split("\n"): | ||
try: | ||
profile_url, username = contributor_data.split("@%@") | ||
contributors.append({ | ||
"profile_url": profile_url, | ||
"user_name": username, | ||
}) | ||
except Exception as error: | ||
print(f"data_retrive_utility.py L54 : {error}") | ||
except Exception as error: | ||
print(f"data_retrive_utility.py L43 : {error}") | ||
return None | ||
|
||
return contributors | ||
|
||
@staticmethod | ||
def get_latest_version(): | ||
""" | ||
Retrieve latest version from a GitHub repository. | ||
Returns: | ||
string: The latest version number. | ||
""" | ||
try: | ||
data = requests.get(DataRetriveUtility.VERSION_FILE_URL).text.strip() | ||
# Extract the version number from the string "VERSION = '2.0.2'" | ||
# Split at "=" and remove extra characters like spaces and quotes | ||
version = data.split('=')[1].strip().strip("'") | ||
|
||
except Exception as error: | ||
print(f"data_retrive_utility.py L43 : {error}") | ||
return None | ||
|
||
return version | ||
|
||
def get_current_version(): | ||
""" | ||
Read current version from info.json file. | ||
return: | ||
string: current version | ||
""" | ||
version = JsonUtility.read_from_file("data\\info.json")["version"] | ||
return version | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters