forked from HoloArchivists/twspace-dl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme and add service example
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,3 +69,51 @@ You can use the following identifiers for the formatting | |
%(url)s | ||
``` | ||
Example: `[%(creator_screen_name)s]-%(title)s|%(start_date)s` | ||
|
||
## Service | ||
There's an example service file [there](../blob/master/[email protected]) | ||
You'll have to modify different stuff depending on how you installed or not the script. | ||
I'd be very grateful if someone made a PR with a bash script automating those ;) | ||
|
||
### Cloned Repository | ||
In that case, you'll have to modify the `WorkingDirectory` to where you cloned the repo. | ||
|
||
### Pip | ||
1. Change `WorkingDirectory` to where you want the spaces to be downloaded. | ||
2. Find where your executable is by running `which twspace_dl` in your terminal. | ||
3. Change the `/usr/bin/python twspace_dl` part to the path of your executable. | ||
|
||
|
||
Now to install the service, you can either install it as a user service(recommended if on your personal desktop), or as a normal service. | ||
|
||
### User | ||
1. Copy the file you modified earlier to `~/.config/systemd/user`(create the systemd directory if it doesn't exist). | ||
2. run | ||
|
||
``` bash | ||
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`) | ||
|
||
To keep it working after restarts run: | ||
|
||
``` bash | ||
systemctl --user enable twspace-dl@USER_ID.service | ||
``` | ||
|
||
### System | ||
1. Copy the file you modified earlier to `/etc/systemd/system`. | ||
2. run | ||
|
||
``` bash | ||
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`) | ||
|
||
To keep it working after restarts run: | ||
|
||
``` bash | ||
sudo systemctl enable twspace-dl@USER_ID.service | ||
``` |
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,9 @@ | ||
[Unit] | ||
Description=Automated download for twitter space by %i | ||
After=network-online.target | ||
|
||
[Service] | ||
WorkingDirectory=/path/to/twspace-dl | ||
ExecStart=/usr/bin/python twspace_dl -U https://twitter.com/%i | ||
Restart=always | ||
RestartSec=15 |
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