Skip to content

Commit

Permalink
Merge pull request #113 from ArmanTaheriGhaleTaki/fix/domain
Browse files Browse the repository at this point in the history
update old domain (twitter.com) to x.com
  • Loading branch information
Ryu1845 authored May 21, 2024
2 parents dac047d + 7c81543 commit f42ea5f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions BASIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ You'll see this window open
Enter cmd in the text bar as shown above and press enter

Once the cmd window is open, enter the location of the file (e.g. `C:\Users\John\Desktop\twspace-dl.exe`), followed by `-i`
and the URL of the space you want to download (e.g. `https://twitter.com/i/space/DeadB33F`)
and the URL of the space you want to download (e.g. `https://x.com/i/space/DeadB33F`)

Such that the result looks somewhat like this
```
C:\Users\John\Desktop\twspace-dl.exe -i https://twitter.com/i/space/DeadB33F
C:\Users\John\Desktop\twspace-dl.exe -i https://x.com/i/space/DeadB33F
```

This should mostly work for ongoing and recorded space
4 changes: 2 additions & 2 deletions SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ systemctl --user daemon-reload
systemctl --user start twspace-dl@USER_ID.service
```

`USER_ID` is the part after `https://twitter.com/` in the url of a twitter profile (i.e `https://twitter.com/USER_ID`)
`USER_ID` is the part after `https://x.com/` in the url of a twitter profile (i.e `https://x.com/USER_ID`)

To keep it working after restarts run:

Expand All @@ -45,7 +45,7 @@ sudo systemctl daemon-reload
sudo systemctl start twspace-dl@USER_ID.service
```

`USER_ID` is the part after `https://twitter.com/` in the url of a twitter profile (i.e `https://twitter.com/USER_ID`)
`USER_ID` is the part after `https://x.com/` in the url of a twitter profile (i.e `https://x.com/USER_ID`)

To keep it working after restarts run:

Expand Down
Binary file modified ffmpeg.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ while true; do

# Start recording
echo "$LOG_PREFIX Start trying..."
/venv/bin/twspace_dl -U "https://twitter.com/${TWITTER_ID}" --write-url "master_urls.txt" --input-cookie-file "$COOKIES_PATH"
/venv/bin/twspace_dl -U "https://x.com/${TWITTER_ID}" --write-url "master_urls.txt" --input-cookie-file "$COOKIES_PATH"

echo "$LOG_PREFIX Sleep $INTERVAL sec."
sleep "$INTERVAL"
Expand Down
8 changes: 4 additions & 4 deletions twspace_dl/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class APIClient:
"""Base API client."""

"""Base URL of the API."""
_API_URL = "https://twitter.com/i/api"
_API_URL = "https://x.com/i/api"

def __init__(self, client: HTTPClient, path: str, cookies: dict[str, str]) -> None:
"""Initialize the API client.
Expand Down Expand Up @@ -253,9 +253,9 @@ def user_id_from_url(self, user_url: str) -> str:
"""Retrieve the numeric user ID (`rest_id`) of the user that the specified profile URL linked to.
Supported URL formats:
- https://twitter.com/<screen_name>
- http://twitter.com/<screen_name>
- twitter.com/<screen_name>
- https://x.com/<screen_name>
- http://x.com/<screen_name>
- x.com/<screen_name>
and with any number of trailing slashes (`/`).
- user_url: The URL pointing to the profile of the Twitter user.
Expand Down
4 changes: 2 additions & 2 deletions twspace_dl/twspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, metadata: dict) -> None:
self.source = metadata
self.root = root
self["id"] = root["rest_id"]
self["url"] = "https://twitter.com/i/spaces/" + self["id"]
self["url"] = "https://x.com/i/spaces/" + self["id"]
self["title"] = root["title"]
try:
self["start_date"] = datetime.fromtimestamp(
Expand Down Expand Up @@ -146,7 +146,7 @@ def from_space_url(cls, url: str):
raise ValueError(
(
"Input URL is not valid.\n"
"The URL format should 'https://twitter.com/i/spaces/<space_id>'"
"The URL format should 'https://x.com/i/spaces/<space_id>'"
)
) from err
return cls(cls._metadata(space_id))
Expand Down

0 comments on commit f42ea5f

Please sign in to comment.