Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hyugogirubato committed May 22, 2023
1 parent f9ac269 commit cc6c6ae
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.4] - 2023-05-22

### Changed

- New domain name from uptobox and automatic correction of the old one.

## [1.0.3] - 2023-05-18

### Changed
Expand Down Expand Up @@ -44,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Initial Release.

[1.0.4]: https://github.com/hyugogirubato/pyuptobox/releases/tag/v1.0.4
[1.0.3]: https://github.com/hyugogirubato/pyuptobox/releases/tag/v1.0.3
[1.0.2]: https://github.com/hyugogirubato/pyuptobox/releases/tag/v1.0.2
[1.0.1]: https://github.com/hyugogirubato/pyuptobox/releases/tag/v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ There's also various functions in `utils.py` that showcases a lot of features.
from pyuptobox.client import Client
from pyuptobox import utils

# Demo: https://uptobox.com/5w4rff6r17oz
# Demo: https://uptobox.eu/5w4rff6r17oz
if __name__ == "__main__":
# create client
client = Client()
file_code = utils.get_code(value="https://uptobox.com/5w4rff6r17oz")
file_code = utils.get_code(value="https://uptobox.eu/5w4rff6r17oz")

# login
data = client.login(token="USER_TOKEN")
Expand Down
2 changes: 1 addition & 1 deletion pyuptobox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .client import Client
from .utils import *

__version__ = "1.0.3"
__version__ = "1.0.4"
4 changes: 2 additions & 2 deletions pyuptobox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Client:

def __init__(self):
self._token = None
self._web = "https://uptobox.com"
self._web = "https://uptobox.eu"
self._api = f"{self._web}/api"
self._session = requests.Session()

Expand Down Expand Up @@ -209,7 +209,7 @@ def add_file(self, file_code: str) -> None:

def get_stream(self, file_code: str) -> list:
KEYS = ["base", "id", "name"]
lines = self._request(url=f"https://uptostream.com/api/streaming/source/get", params={
lines = self._request(url=f"https://uptostream.eu/api/streaming/source/get", params={
"file_code": file_code
})["data"]["sources"].split("\n")

Expand Down
2 changes: 2 additions & 0 deletions pyuptobox/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def get_size(bytes_size: int) -> str:


def get_code(value: str) -> str:
if re.search(r"\.com\\", value):
value = re.sub(r"\.com\\", ".eu", value)
if value.startswith("https://"):
value = re.search(r"\.com/(\w+)", value).group(1)
if not value or len(value) != 12:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="pyuptobox",
version="1.0.3",
version="1.0.4",
description="Python SDK to interact with Uptobox API.",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit cc6c6ae

Please sign in to comment.