Giter VIP home page Giter VIP logo

foxwq-sgf-dl's Introduction

foxwq-sgf-dl

A Python package for downloading Go game records from FoxWQ.

Features

  • Download all or a specific number of game records for a given user.
  • Filter games by user ID or username.
  • Save downloaded go game records in SGF format.
  • Keep track of downloaded games to avoid duplicate downloads.
  • Flexible configuration options

Requirements

  • Python 3.6+
  • Required packages (install with pip install -r requirements.txt)

Installation

To use this package, you first need to have Python installed. Follow these steps to set it up:

  1. Clone the Repository:

    git clone https://github.com/yiqiaoli/foxwq-sgf-dl.git
  2. Navigate to the Project Directory:

    cd foxwq-sgf-dl
  3. Install Dependencies: If you're using venv:

    python -m venv venv
    source venv/bin/activate

    Install the requirements:

    pip install -r requirements.txt

    Alternatively, you can install the package directly:

    pip install . 

Usage

Command-Line Help

To view the help information for the command-line tool, use:

foxwq_sgf_dl --help

How to run the package

After setting up the package, you can run the following commands:

Download All Games:

foxwq_sgf_dl --config path/to/config.cfg --all-games

Replace path/to/config.cfg with the path to your configuration file.

Download Recent Games:

foxwq_sgf_dl --config path/to/config.cfg --number-of-games 10

Replace 10 with the desired number of recent games to download.

Download Games with foxwq_sgf_dl (Default Behavior):

foxwq_sgf_dl

When run without any options, foxwq_sgf_dl uses the default configuration file and downloads all games unless a specific number of recent games is specified in the configuration file.

For Developers

Alternatively, run the package directly using the command:

python -m foxwq_sgf_dl.downloader

Configuration

Before running the tool, you need to configure the config.cfg file. Below is an example configuration:

[DEFAULT]
# User identifier and password used for login
login_identifier = <your_login_identifier>
password = <your_password>

# Authentication details
# - Source user ID (uid) to fetch game records
# - Timestamp for the API requests
# - Authentication token
# - Session ID
srcuid = <your_source_uid>
time_stamp = <your_timestamp>
token = <your_token>
session = <your_session>

# Username to search for specific games
search_username = <your_search_username>

# Directory to save downloaded game records (SGF files)
directory = ../games

Note: The login API can be used to obtain srcuid, time_stamp, and token, but we haven't yet figured out how session is calculated from those three. Currently, these values are hardcoded in the configuration file.

Sample Configuration File

A sample configuration file is provided as sample_config.cfg for your reference. Rename the sample_config.cfg to config.cfg if you use it as a template.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Acknowledgments

Special thanks to 李炯介(Ivan Li) and the FoxWQ community.

foxwq-sgf-dl's People

Contributors

yiqiaoli avatar

Stargazers

 avatar Yanhua Zheng avatar Hayden Johnson avatar  avatar

Watchers

 avatar Hayden Johnson avatar

Forkers

chewt uestccokey

foxwq-sgf-dl's Issues

Unclear how to obtain info for config file

First off, nice project! I was looking for something like this just the other day, and I'm glad to see someone working on it.

You mention that you can obtain some of the info via the login api, but how do I do that? Do I need to open wireshark and watch the actual traffic? Or is there another way that works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.