Skip to main content

동행복권 비공식 API

Project description

DongHaeng Lottery API (Unofficial)

❯❯❯ dhapi buy_lotto645

[Lotto645 Buy Request]
Game A: ['x', 'x', 'x', 'x', 'x', 'x']
Game B: ['x', 'x', 'x', 'x', 'x', 'x']
Game C: ['x', 'x', 'x', 'x', 'x', 'x']
Game D: ['x', 'x', 'x', 'x', 'x', 'x']
Game E: ['x', 'x', 'x', 'x', 'x', 'x']
----------------------
❓ 위와 같이 구매하시겠습니까? [Y/n] y
✅ 구매를 완료하였습니다.
[Lotto645 Buy Response]
------------------
Round:		1068
Barcode:	54095 53510 29208 58505 11515 12578
Cost:		5000
Numbers:
		A|01|05|28|33|35|45 (자동)
		B|01|13|14|38|40|41 (자동)
		C|02|28|30|32|36|39 (자동)
		D|20|25|32|33|34|41 (자동)
		E|14|26|28|31|35|45 (자동)
Message:	SUCCESS
----------------------
❯❯❯ echo Cool.
Cool.

동행복권 사이트를 터미널에서 이용할 수 있게 랩핑한 API입니다.

Python 3.8 이상에서 설치해야 최신버전이 작동합니다.

구현된 기능

사용법

계정 정보 세팅

~/.dhapi/credentials 파일에 username, password를 입력하면 자동으로 로그인합니다. profile을 여러개 설정할 수 있습니다.

[!NOTE] TOML 문법을 사용합니다. 따라서 value 값은 쌍따옴표를 사용해야 합니다.

[!WARNING] \" + USERNAME/PASSWORD + \" 형식에 맞게 계정 정보를 작성해야 합니다.
예) username이 myName일 때 => \"myName\"

DHAPI_USERNAME=\"asdf\"
DHAPI_PASSWORD=\"****\"

mkdir -p ~/.dhapi
cd ~/.dhapi

# 기본 사용자는 [default]로 명시
echo "[default]" > credentials
echo username = "$DHAPI_USERNAME" >> credentials # username
echo password = "$DHAPI_PASSWORD" >> credentials # password (미리 복잡한 난수로 변경하시길 권장합니다)
DHAPI_USERNAME=\"qwer\"
DHAPI_PASSWORD=\"5678\"

cd ~/.dhapi

echo "" >> credentials
echo "[${DHAPI_USERNAME:1:-1}]" >> credentials
echo username = "$DHAPI_USERNAME" >> credentials
echo password = "$DHAPI_PASSWORD" >> credentials

-u $USER_ID 파라미터를 이용하면 명령어 실행 중 비밀번호를 입력받는 방법도 있지만, 권장하지 않습니다.

설치 밎 사용법

pip install --upgrade pip # pip 가 최신 버전이 아니면 dhapi 구버전이 깔리는 경우가 있습니다
pip install dhapi

dhapi -h

# 자동모드로 5장 구매
dhapi buy_lotto645 -q # profile: default
dhapi buy_lotto645 -q -p qwer # profile: qwer

기여하기

기여는 대환영입니다! CONTRIBUTING.md 파일을 참고해주세요.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dhapi-3.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dhapi-3.1.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file dhapi-3.1.0.tar.gz.

File metadata

  • Download URL: dhapi-3.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for dhapi-3.1.0.tar.gz
Algorithm Hash digest
SHA256 c46e4d6370a8f730309f0654875021e379462dd2eb3490595f6cdc884fa58154
MD5 ebf70106e5e7e69b3146f6da0fe2c6c4
BLAKE2b-256 b108855b3baaee7bc6d38fd02fcea153f07da4aeb78c91ced9f261ab4002e057

See more details on using hashes here.

File details

Details for the file dhapi-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: dhapi-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for dhapi-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55a602c8f79bfae1b2bd63f9e551343031a4689c5ef2c575649190dd31ca8a33
MD5 07dc5544092ccf727d0b0b852bb1be07
BLAKE2b-256 7a55ac15f34de4b8fb2b7a390dab86155978e669806c2f10d032726689f0037a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page