Skip to content

Commit

Permalink
Merge pull request #38 from huanghyw/feature-hyw-qrcode_login
Browse files Browse the repository at this point in the history
Feature hyw qrcode login
  • Loading branch information
huanghyw authored Dec 22, 2020
2 parents 121cd42 + 359fe4f commit 7a49008
Show file tree
Hide file tree
Showing 6 changed files with 383 additions and 103 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ venv.bak/
logs/
.test
test/
cookies/
*.cookies
qr_code.png

# jupyter
.ipynb_checkpoints
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
通过我这段时间的使用(2020-12-12至2020-12-17),证实这个脚本确实能抢到茅台。我自己三个账号抢了四瓶,帮两个朋友抢了4瓶。
大家只要确认自己配置文件没有问题,Cookie没有失效,坚持下去总能成功的。


## 暗中观察

根据12月14日以来抢茅台的日志分析,大胆推断再接再厉返回Json消息中`resultCode`与小白信用的关系。
Expand Down Expand Up @@ -83,10 +84,8 @@
> 随便找一个商品下单,然后进入结算页面,打开浏览器的调试窗口,切换到控制台Tab页,在控制台中输入变量`_JdTdudfp`,即可从输出的Json中获取`eid``fp`
> 不会的话参考原作者的issue https://github.com/zhou-xiaojun/jd_mask/issues/22
(2)`cookies_String`,`sku_id`,`DEFAULT_USER_AGENT`(和cookie获取同一个地方就会看到.直接复制进去就可以了)
> 这里注意每次扫码登陆后都需要重新获取cookies_string,其他两个不用
> `cookies_string` 就是`http request header`里面的`cookie`
> Cookie最好在订单结算页面获取
(2)`sku_id`,`DEFAULT_USER_AGENT`(`user-agent`在cookie获取的那个地方就会看到.直接复制进去就可以了)
> `cookies_string` 现在已经不需要填写了
> sku_id我已经按照茅台的填好
(3)配置一下时间
Expand Down
18 changes: 9 additions & 9 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[config]
# eid, fp参数必须填写,具体请参考 wiki-常见问题
# 随意填写可能导致订单无法提交等问题
eid = "XMKWG35OFYBQN3C5JYD7J4FNOWNXSGBIZNIKBUVVQEMJW6766KKTNYZD43U3Y7VCWA73EEWJRCOTKU7QVG3WKUNNQA"
fp = "2ea01d1acb70ab62c8607786d7273205"
# cookie
cookies_String ="__jdu=1586273021865136663377; shshshfpa=1d79a82c-037d-8e4e-47cb-e35d2f9e66ae-1586273130; shshshfpb=ypTYIktPFs89QK5nxn8nGIw%3D%3D; unpl=V2_ZzNtbRYHRxZ1X0EBfktdDGIDEFoSUhccJlxHXHNOWAQ3V0YJclRCFnQUR1BnGlQUZwQZWEdcQRBFCEdkeB5fA2AFEFlBZxpFK0oYEDlNDEY1WnxdRF9DFnEAR1B9KWwGZzMSXHJXRxxyC0BWehpcDGAHEl9FUEQXdw5AZEsebDVXARpZR1NHJXQ4R2Q5TQAFbgUQXA9XRxxyC0BWehpcDGAHEl9FUEQXdw5AZHopXw%3d%3d; __jdv=76161171|haosou-search|t_262767352_haosousearch|cpc|1791259057_0_ea521f6d4c084136a4e8be099f50aeee|1590741875314; user-key=e7b2ce43-c8ea-498b-aa14-1d72ba811c3b; cn=14; ipLocation=%u5e7f%u897f; pinId=RKLv5CxPY3leYrbiqjD_zrV9-x-f3wj7; pin=243864730-341142; unick=%E8%9B%8B%E9%BB%84%E9%85%B1%E5%95%8A%E5%AE%9D%E5%AE%9D; ceshi3.com=201; _tp=G9fKS8tOq9vYWtFzoQL6S58tnu1J7NXnsaIj9rKmcI8%3D; _pst=243864730-341142; areaId=20; ipLoc-djd=20-1761-25188-0; TrackID=164w4EaXgdVB8pmGgufMvZxffVg93QU3DR1qoyUmb9AbFnt_XMZ4cCggrBVqxQbwH6Sq6wvHiQ0tfbjTM9Mez0AhaI61woZr-qrMvbKOsZZT67SVvoLrkZfKMAeezI4Xx; thor=721925D5F86146929EDB9E937057356EBD65E8075AF346CDA6DFD00A839FDAAE5B800AD469815047B419498006934452FA72C6513EDDC62E79BDBB5883B46087391FF3C8EE2E5C2246FA96BF54ADD140DF2918C35D29DCE2BE90D0FEBEE2263DEEE9DEE73277CFE2BC97AA575462FDE847C8209285C17235C0566829976AABB1BFDA92428C8EA169ADB615E06CB05003B543B48B7BD5F744BDED08A66B10D5D3; __jda=122270672.1586273021865136663377.1586273022.1591320625.1591667887.11; __jdc=122270672; 3AB9D23F7A4B3C9B=XMKWG35OFYBQN3C5JYD7J4FNOWNXSGBIZNIKBUVVQEMJW6766KKTNYZD43U3Y7VCWA73EEWJRCOTKU7QVG3WKUNNQA; __jdb=122270672.8.1586273021865136663377|11.1591667887; shshshfp=4d12604ada2ade89734b633f704fe848; shshshsID=b512228e41868a27ab8199eb73396a90_4_1591667938758"
eid = ""
fp = ""
# cookie现在不需要填写了
# cookies_String = ""

#cookies_String = "__jdu=1586273021865136663377; shshshfpa=1d79a82c-037d-8e4e-47cb-e35d2f9e66ae-1586273130; shshshfpb=ypTYIktPFs89QK5nxn8nGIw%3D%3D; ceshi3.com=201; unpl=V2_ZzNtbRYHRxZ1X0EBfktdDGIDEFoSUhccJlxHXHNOWAQ3V0YJclRCFnQUR1BnGlQUZwQZWEdcQRBFCEdkeB5fA2AFEFlBZxpFK0oYEDlNDEY1WnxdRF9DFnEAR1B9KWwGZzMSXHJXRxxyC0BWehpcDGAHEl9FUEQXdw5AZEsebDVXARpZR1NHJXQ4R2Q5TQAFbgUQXA9XRxxyC0BWehpcDGAHEl9FUEQXdw5AZHopXw%3d%3d; __jdv=76161171|haosou-search|t_262767352_haosousearch|cpc|1791259057_0_ea521f6d4c084136a4e8be099f50aeee|1590741875314; areaId=20; user-key=e7b2ce43-c8ea-498b-aa14-1d72ba811c3b; TrackID=14zpGGB-OpJ4mkipibzlKLH_cntpvRWi1YuLUjQQ9V-kkhdgGNzIYgnDptMlqfJhNhu8ozJ_qMXppTXszcg6uSBKf3xsYTd9LGMPVWn_V3mfk98AjllQ77oNoZNf0vk_n; pinId=tnz4f2JFgMgyIVQ1is9ieg; pin=275466402_m; unick=%E4%B8%8D%E6%83%B3%E8%B7%91%E6%AD%A5%E7%9A%84%E5%B9%B2%E9%94%85%E9%94%85; _tp=hbuicMy40IDnjEA3yKCYJg%3D%3D; _pst=275466402_m; __jda=122270672.1586273021865136663377.1586273022.1590741875.1590853863.6; __jdc=122270672; shshshfp=4502485e8b520f53be89fe44a27717ee; 3AB9D23F7A4B3C9B=XMKWG35OFYBQN3C5JYD7J4FNOWNXSGBIZNIKBUVVQEMJW6766KKTNYZD43U3Y7VCWA73EEWJRCOTKU7QVG3WKUNNQA; cn=14; ipLoc-djd=20-1761-25188-51466.2052701265; ipLocation=%u5e7f%u897f; __tak=c94559a7e3893645ee7f9f3ba3af391b4381d8e935b4895cf5f4df48e014c4aca54c30a40df88a95e670fcf3ef153823cfc92c013e7e892133119c9f79811f1b9303c52b4dffffebb6b145cbe13fc0e0; thor=A3006E40DFDA6A23E9353F8A5BE5D7B526D907891A33D2D63A28B4F6F19DC6F67E8BAA1251F8FC51DA54936D111277AEF79F42D5BBCA8C7F01068EA42B4B681CF3D78B4CB73DF9E870791980E609BABE4426FF4EF4089405842C640217A10FEC30256F6BC66C63C67D595F08AE093A375782F916DE74D980FE9E18720F2D5987B03269FB13DC923CCCEC51A5FD7155FD; shshshsID=b122acc455c4e500fe48a45f327cbeac_17_1590855792368; __jdb=122270672.25.1586273021865136663377|6.1590853863"
# 商品id,已经是茅台的sku_id了
# 商品id
# 已经是茅台的sku_id了
sku_id = 100012043978
# 设定时间 # 2020-02-24 10:00:00.100000
buy_time = 2020-06-09 10:00:00.150
# 设定时间 # 2020-12-09 10:00:00.100000
buy_time = 2020-12-22 09:59:59.500
# 默认UA
DEFAULT_USER_AGENT = ""
DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
# 是否使用随机 useragent,默认为 false
random_useragent = false

Expand Down
10 changes: 10 additions & 0 deletions exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
# -*- encoding=utf8 -*-
from jd_logger import logger


class SKException(Exception):

def __init__(self, message):
super().__init__(message)
logger.error(message)
Loading

0 comments on commit 7a49008

Please sign in to comment.