8000 GitHub - kingwingfly/fav: Back up your favorite bilibili resources with CLI.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kingwingfly/fav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

fav

Back up your favorite bilibili resources with CLI.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Product Name Screen Shot

Back up your favorite bilibili online resources with CLI.

⚠️: There's a broken change between v0 and v1, details in CHANGELOG.md

(back to top)

Built With

  • Rust

(back to top)

Getting Started

You can download the release here (Due to ffmpeg dynamic linking, version >= 1.1.0 is not provided in release page, you can compile by yourself.).

For Arch Linux users, you can yay -S fav-git maybe, someone has maken it a package.

Or you can compile by yourself:

  1. Install ffmpeg and pkgconf
     # e.g.
     sudo pacman -S ffmpeg pkgconf
     # or
     brew install ffmpeg pkgconf
  2. Clone the repo
    git clone https://github.com/kingwingfly/fav.git
  3. Compilation
    cargo build --release

Or after installing ffmpeg and pkgconf, run cargo install fav_bili.

(back to top)

Usage

Need libavformat able to be dynamic linked (pkgconf --list-all | grep libav).

Back up your favorite bilibili online resources with CLI.

Usage: fav [OPTIONS] [COMMAND]

Commands:
  auth        Auth account
  list        List accounts/sets/ups/medias [alias: ls, l]
  activate    Activate obj [alias: active, a]
  deactivate  Deactivate obj [alias: d]
  fetch       Fetch metadata of following ups, fav sets, medias, ups [alias: f]
  pull        Pull fetched medias [alias: p]
  like        Like medias
  completion  Generate completion script
  help        Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose  Show debug messages
  -h, --help     Print help
  -V, --version  Print version

Steps

  1. Login first
  2. Fetch the favorite sets(lists)
  3. Activate the list or up you want. You can see them through fav ls
  4. Fetch active resources
  5. Pull the resources

Example

# auto completion is supported; e.g. fish
fav completion fish > ~/.config/fish/completions/fav.fish
# For Windows users
echo "fav completion powershell | Out-String | Invoke-Expression" >> $PROFILE
# scan code to login
fav auth login # you can also login with `fav usecookies`
# fetch following ups and fav sets
fav fetch
# show sets
fav ls set
# activate set or up
fav activate
# pull videos
fav fetch
fav pull
# deactivate set or up
fav deactivate
# after fetching, you can find your favorite upper
# limbo/sqlite3 .fav/fav.db
SELECT u.up_id, u.name, COUNT(u.up_id) count FROM up u LEFT JOIN media_up mu ON u.up_id=mu.up_id JOIN media m ON mu.id=m.id GROUP BY u.up_id, u.name ORDER BY count;
# you can also like medias, should usecookies when login
fav like
# or like all medias faved
fav ls v | sed '1d;$d' | awk '{print $2;}' | xargs fav like
# check cookies usability
fav auth check -a

Service example:

# /etc/systemd/system/fav.service
[Unit]
Description=Fav Service
After=network-online.target

[Service]
Type=oneshot
User=your_user
WorkingDirectory=/path/to/fav_set
ExecStart=/bin/sh -c "/usr/local/bin/fav fetch && /usr/local/bin/fav pull"

# /etc/systemd/system/fav.timer
[Unit]
Description=Run fav service every 3 hours

[Timer]
OnCalendar=*-*-* 0/3:00:00
# or >
AccuracySec=1m
Persistent=true

[Install]
WantedBy=timers.target
sudo systemctl daemon-reload
sudo systemctl enable fav.timer
sudo systemctl start fav.timer

You can also achieve the goal with systemd timer by yourself, but it's a little hard to learn.

For more examples, please refer to the Documentation

(back to top)

Develop

sea-orm-cli is used to handle database ops.

cargo binstall sea-orm-cli # or `cargo install sea-orm-cli`
# generate ORM code
./sea-orm.sh

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Moreover, it is recommended to open an issue before coding to avoid repeated and useless work.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Louis - 836250617@qq.com

Project Link: https://github.com/kingwingfly/fav

(back to top)

Acknowledgments

(back to top)

About

Back up your favorite bilibili resources with CLI.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  
0