陽光寬頻加密演算法破解,找出隱藏真實地址。
阿新 • • 發佈:2018-11-03
首先,用charles手機抓包(怎麼抓包就不介紹了。網上很多介紹)。抓出今日頭條應用西瓜視訊列表頁。
列表頁網址類似於:
http://iu.snssdk.com/api/news/feed/v64/?
引數:
FP = FlTqL25rL2cuFlctPlU1FlFSFzwu&VERSION_CODE = 6.5.5&APP_NAME = news_article&VID = ***&DEVICE_ID = ***&通道=應用%20Store&解析度= 1242 * 2208&援助= 13&ab_version = 304490,313413,319437,317498,295827,323879,239095,324284,170988,325960, 320218,325197,327236,281389,330632,297059,276203,286212,313219,328615,329603,277770,329374,322322,327536,316224,329437,330640,330800,317412,330202,323233,328671,326119,324796, 317076,280773,330092,319959,326729,322544,330721,214069,31241,295923,323966,324537,258356,247848,281297,328218,330230,325612,330768,326804,327912,288416,260653,326192,324617, 271178,326591,326524,326532&ab_feature = 201617,Z1&ab_group = 201617&openudid = ***&IDFV = ***** WIFI&OS_VERSION = 10.1.1&ssmix = A&DEVICE_PLATFORM = iphone&IID = ***&ab_client = A1,F2,F7,E1&DEVICE_TYPE = iPhone%206S %20Plus&IDFA = 5454D543-05A7-4A39-94EE-2DA64E500D1D&詳細= 1&類別= subv_society&list_entrance = main_tab&last_refresh_sub_entrance_interval = 260&tt_from = pre_load_more&計數= 20&loc_mode = 1&LBS_status = authroize&CP = 53A7DfD49aDB6q1&max_behot_time = 1524461228&影象= 1&嚴格= 0&語言= ZH-漢斯-CN&參閱= 1&為= a2b599ad763bca3dad2851&TS = 1524473270
涉及個人隱私的用***表示了..只要重點看4個引數,並給出大概意思:
tt_from = ['pull','pre_load_more','load_more']#三個值表示是否還有資料,第一次開啟為拉
last_refresh_sub_entrance_interval#app停留時間,此時間值最好處於ts及tt之間。
ts#本次請求時
tt#上次請求時間,記住tt時間等於上一次的ts時間。
另外:如,CP的值跟toutiao網頁版的值並不一樣位數變長了但是去掉這兩個引數依然能請求到列表頁。
既然獲取了列表頁,那就是一串JSON格式的資料,吐槽下..這比調取新浪新聞的JSON乾淨整潔多了..
JSON:
{\ “抽象\”:\“微微一笑很傾城:美女學霸貝微微,立志成為遊戲工程師,化名‘蘆葦微微’躋身網遊高手,因拒絕上傳真實照片而慘遭俠侶‘真水無香’無情拋棄,卻意外得到江湖第一高手“一笑奈何”的垂青。為了贏得“俠侶挑戰賽”,貝微微欣然答應與“一笑奈何”結盟並組隊參賽。兩人一路闖蕩江湖早已心靈相通,可貝微微\“,\”action_extra \“:\”{\\\“channel_id \\\”:5443492149} \“,\”action_list \“:[{\”action \“:1,\”desc \ \ “\”,\ “額外的\”:{}},{\ “動作\”:3,\ “DESC \”:\ “\”,\ “額外的\”:{}},{\“動作\ “:7,\” DESC \ “:\” \” \ “額外\”:{}},{\ “動作\”:9,\ “DESC \”:\ “\” \ “額外\” :{}}],\ “aggr_type \”:1,\ “allow_download \”:假,\ “article_sub_type \”:0,\ “article_type \”:0,\ “article_url \”:\“HTTP:// toutiao.com/item/6517779113703375367/\",\"ban_comment\":0,\ “ban_danmaku \”:假,\ “behot_time \”:1524821490,\ “bury_count \”:0,\ “cell_flag \”:262155,\ “cell_layout_style \”:1,\ “單元型別\”:0,\” COMMENT_COUNT \ “:1,\” content_decoration \ “:\” \ “\ ”游標\“:1524821490999,\ ”danmaku_count \“:0,\ ”digg_count \“:0,\ ”DISPLAY_URL \“:\” HTTP ://toutiao.com/group/6517779113703375367/ \”,\ “filter_words \”:[{\ “ID \”:\ “8:0 \”,\ “is_selected \”:假,\ “名稱\”: \ “看過了\”},{\ “ID \”:\ “9:1 \” \ “is_selected \”:假,\ “名稱\”:\ “內容太水\”},{\” ID \ “:\” 5:1473621500 \ “\ ”is_selected \“:假,\ ”名稱\“:\ ”拉黑作者:調侃大劇\“},{\ ”ID \“:\” 6: 23937 \ “\”is_selected \ “:虛假,\” 名稱\ “:\” 不想看:楊洋\ “},{\” ID \ “:\” 6:16182 \”,\ “is_selected \”:虛假,\ “名稱\” :\ “不想看:鄭爽\”}],\ “forward_info \”:{\ “forward_count \”:0},\ “group_flags \”:32832,\ “GROUP_ID \”:6517779113703375367,\ “has_m3u8_video \” :假,\ “has_mp4_video \”:0,\ “has_video \”:真,\ “熱\”:0,\ “ignore_web_transform \”:1,\ “is_subject \”:假,\ “ITEM_ID \”:6517779113703375367 ,\ “item_version \”:0,\ “關鍵字\”:\ “一笑奈何,肖奈,鄭爽,貝微微,風雲人物\”,\ “large_image_list \”:[{\ “高度\”:326, \ “URI \”:\ “video1609 / 5e83000361230d3099ed \”,\ “URL \”:\ “HTTP://p1.pstatp.com/video1609/5e83000361230d3099ed \”,\ “URL_LIST \”:[{\ “URL \”:\ “HTTP://p1.pstatp.com/video1609/5e83000361230d3099ed \”},{\ “URL \”:\“HTTP://pb3.pstatp.com/video1609/5e83000361230d3099ed \ “},{\” URL \ “:\” HTTP://pb9.pstatp.com/video1609/5e83000361230d3099ed \ “}],\” 寬度\ “:580}],\” 電平\ “:0,\” log_pb \ “:{\” impr_id \ “:\” 20180427173130010008043088280EE8 \ “},\” media_info \ “:{\” avatar_url \ “:\” HTTP://p7.pstatp.com/large/7b93000550adf78a0e7f \”,\ “遵循\”:虛假,\ “is_star_user \”:虛假,\ “media_id \”:1576605181968398,\ “名稱\”:\ “調侃大劇\”,\ “recommend_reason \”:\ “\”,\” recommend_type \ “:0,\” user_ID的\ “:67211836630,\” user_verified \ “:真實的,\” verified_content \ “:\” \ “} \”MEDIA_NAME \ “:\” 調侃大劇\ “\ ”middle_image \“:{\ ”高度\“:360,\ ”URI \“:\ ”目錄/ 5e83000361230d3099ed \“,\ ”URL \“:\” HTTP ://p1.pstatp.com/list/300x196/5e83000361230d3099ed.webp \ “\ ”URL_LIST \“:[{\ ”URL \“:\” http://p1.pstatp.com/list/300x196/5e83000361230d3099ed .WEBP \ “},{\” URL \ “:\” HTTP://pb3.pstatp.com/list/300x196/5e83000361230d3099ed.webp \ “},{\” URL \ “:\” HTTP:// PB9 .pstatp.com /列表/ 300x196 / 5e83000361230d3099ed.webp \ “}],\” 寬度\ “:640},\” need_client_impr_recycle \ “:1,\” publish_time \ “:1517538706,\” read_count \“:572, \ “RID \”:\ “20180427173130010008043088280EE8 \”,\ “SHARE_COUNT \”:0,\ “share_info \”:{\ “cover_image \”:空,\ “描述\”:空,\ “share_type \”:{\ “PYQ \”:2,\ “QQ \”:0,\ “QQ空間\”:0,\ “WX \”:0},\ “SHARE_URL \”:\” HTTPS://m.365yg.com/a6517779113703375367/ IID = 23331545249 \\ u0026app = news_article \ “\ ”稱號\“:\”!鄭爽自稱家族全是強盜鄭爽百般解釋楊洋卻一直黑臉\ “},\” share_type \ “:2,\” SHARE_URL \ “:\” HTTPS:?//m.365yg.com/a6517779113703375367/ IID = 23331545249 \\ u0026app = news_article \”,\ “show_dislike \”:真,\ “show_portrait \”:假,\ “show_portrait_article \”:假,\ “源\”:\ “調侃大劇\”,\ “source_icon_style \”:6,\ “source_open_url \”:\“sslocal:/ /輪廓參閱=視訊\\ u0026uid = 67211836630 \ “\ ”標籤\?“:\ ”video_game \“,\ ”TAG_ID \“:6517779113703375367,\ ”尖\“:0,\ ”標題\“:\”鄭爽自稱家族全是強盜鄭爽百般解釋楊洋卻一直黑臉\ “\ ”ugc_recommend \!“:{\ ”活動\“:\ ”\“,\ ”理性\“:\” 優酷旗下頭條號\ “} \” URL \ “:\” HTTP://toutiao.com/item/6517779113703375367/ \ “\ ”USER_INFO \“:{\ ”avatar_url \“:\” HTTP://p3.pstatp。 COM /拇指/ 7b93000550adf78a0e7f \ “\ ”描述\“:\ ”最新大劇大綜,熱門影片,提供視訊播放,視訊釋出,視訊服務平臺\“,\ ”遵循\“:虛假,\” FOLLOWER_COUNT \ “:0,\”name \“:\”調侃大劇\“,\”user_auth_info \“:\”{\\\“auth_type \\\”:\\\“0 \\\”,\\\ “auth_info \\\”:\\\“優酷旗下頭條號\\\”} \“,\”user_id \“:67211836630,\”user_verified \“:true,\”verified_content \“:\”優酷旗下頭條號\ “},\” user_repin \ “:0,\” user_verified \ “:1,\” verified_content \“:\ “優酷旗下頭條號\”,\ “video_detail_info \”:{\ “detail_video_large_image \”:{\ “高度\”:326,\ “URI \”:\ “video1609 / 5e83000361230d3099ed \”,\ “URL \” :\ “HTTP://p1.pstatp.com/video1609/5e83000361230d3099ed \”,\ “URL_LIST \”:[{\ “URL \”:\ “HTTP://p1.pstatp.com/video1609/5e83000361230d3099ed \” },{\ “URL \”:\ “HTTP://pb3.pstatp.com/video1609/5e83000361230d3099ed \”},{\ “URL \”:\“http://pb9.pstatp.com/video1609/5e83000361230d3099ed \ “}],\” 寬度\ “:580},\” direct_play \ “:1,\” group_flags \ “:32832,\” show_pgc_subscribe \ “:1,\” VIDEO_ID \ “:\” cf424d580c684435a3241672d9863e02 \”, \ “video_preloading_flag \”:1,\ “video_type \”:0,\ “video_watch_count \”:674,\”video_watching_count \ “:0},\” VIDEO_DURATION \ “:121,\” VIDEO_ID \ “:\” cf424d580c684435a3241672d9863e02 \ “\ ”video_play_info \“:\ ”{\\\“ 狀態\\\”:10,\\ \ “訊息\\\”:\\\ “成功\\\”,\\\ “VIDEO_DURATION \\\”:122.11,\\\ “驗證\\\”:\\\ “\\\”,\ \\ “enable_ssl \\\”:假的,\\\ “poster_url \\\”:\\\ “HTTP://p3.pstatp.com/origin/5f2d000a55e2e5b7ff57 \\\”,\\\“auto_definition \\ \ “:\\\” 360p的\\\ “\\\ ”original_play_url \\\“:{\\\ ”backup_url \\\“:\\\” http://voffline.byted.org/download/米/ 41ba400001555c3fa5b1f / \\\ “\\\ ”main_url \\\“:\\\ ”HTTP://voffline.byted.org/download/m/41ba400001555c3fa5b1f/ \\\“},\\\” video_list \\\ “:{\\\” VIDEO_1 \\\ “:{\\\”定義\\\ “:\\\” 360P \\\”,\\\ “V型\\\”:\\\ “MP4 \\\”,\\\ “vwidth \\\”:640,\\ \ “vheight \\\”:360,\\\ “位元率\\\”:153656,\\\ “logo_type \\\”:\\\ “xigua \\\”,\\\“codec_type \\\ “:\\\” H264 \\\ “\\\ ”大小\\\“:3383048,\\\ ”main_url \\\“:\\\ ”aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vYTZhOWJlOGJlYWJlNGZhYTEzZTVjYmIxOGY0NDBkY2IvNWFlMmZjN2MvdmlkZW8vbS8yMjBmMjc1MGYwZjQ5ZmM0NGY1YjBhMzIyZmRiZDMzYzFiZTExNTNmZjdiMDAwMTExM2Q0OWY2OGUwYS8 = \\\“,\\\” backup_url_1 \\\ “:\\\” aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS84ODY1NGJhZDBhYzU1MzAwMzJjYjk0ZmZhMmIyMWNhNS81YWUyZmM3Yy92aWRlby9tLzIyMGYyNzUwZjBmNDlmYzQ0ZjViMGEzMjJmZGJkMzNjMWJlMTE1M2ZmN2IwMDAxMTEzZDQ5ZjY4ZTBhLw == \\\ “\\\ ”main_http_url \\\“:\\\”aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vYTZhOWJlOGJlYWJlNGZhYTEzZTVjYmIxOGY0NDBkY2IvNWFlMmZjN2MvdmlkZW8vbS8yMjBmMjc1MGYwZjQ5ZmM0NGY1YjBhMzIyZmRiZDMzYzFiZTExNTNmZjdiMDAwMTExM2Q0OWY2OGUwYS8 = \\\”,\\\ “backup_http_url \\\”:\\\ “aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS84ODY1NGJhZDBhYzU1MzAwMzJjYjk0ZmZhMmIyMWNhNS81YWUyZmM3Yy92aWRlby9tLzIyMGYyNzUwZjBmNDlmYzQ0ZjViMGEzMjJmZGJkMzNjMWJlMTE1M2ZmN2IwMDAxMTEzZDQ5ZjY4ZTBhLw == \\\”,\\\ “user_video_proxy \\\”:1,\\\ “socket_buffer \\\” :3457260,\\\ “preload_size \\\”:327680,\\\ “preload_interval \\\”:45,\\\ “preload_min_step \\\”:5,\\\ “preload_max_step \\\”:10 ,\\\ “encryption_key \\\”:\\\ “\\\”,\\\ “player_access_key \\\”:\\\ “\\\”},\\\ “video_2 \\\”: {\\\ “的定義\\\”:\\\ “480P \\\”,\\\”V型\\\ “:\\\” MP4 \\\”,\\\ “vwidth \\\”:854,\\\ “vheight \\\”:480,\\\ “位元率\\\”: 236403,\\\ “logo_type \\\”:\\\ “xigua \\\”,\\\ “codec_type \\\”:\\\ “H264 \\\”,\\\“大小\\\ “:4644300,\\\” main_url \\\ “:\\\” aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMDE1MTRlNDM0YzU0ZGJlOWY4YzcxODFjOTUwYTA5MmYvNWFlMmZjN2MvdmlkZW8vbS8yMjA3YjFlMTE5ZjdkZjY0Mjg2YTI0YjhhZDcyMGZhYWM0YjExNTNlZTc1MDAwMTIzYjA0NDY2ZDczZC8 = \\\”,\\\ “backup_url_1 \\\”:\\\ “aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9mMTg5NDAwNzY3NzhiMjlmMzkzNzNmZDA5ZGNhNzZkMC81YWUyZmM3Yy92aWRlby9tLzIyMDdiMWUxMTlmN2RmNjQyODZhMjRiOGFkNzIwZmFhYzRiMTE1M2VlNzUwMDAxMjNiMDQ0NjZkNzNkLw == \\\”,\\\ “main_http_url \\\”:\\\”aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMDE1MTRlNDM0YzU0ZGJlOWY4YzcxODFjOTUwYTA5MmYvNWFlMmZjN2MvdmlkZW8vbS8yMjA3YjFlMTE5ZjdkZjY0Mjg2YTI0YjhhZDcyMGZhYWM0YjExNTNlZTc1MDAwMTIzYjA0NDY2ZDczZC8 = \\\”,\\\ “backup_http_url \\\”:\\\ “aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9mMTg5NDAwNzY3NzhiMjlmMzkzNzNmZDA5ZGNhNzZkMC81YWUyZmM3Yy92aWRlby9tLzIyMDdiMWUxMTlmN2RmNjQyODZhMjRiOGFkNzIwZmFhYzRiMTE1M2VlNzUwMDAxMjNiMDQ0NjZkNzNkLw == \\\”,\\\ “user_video_proxy \\\”:1,\\\ “socket_buffer \\\” :5319000,\\\ “preload_size \\\”:327680,\\\ “preload_interval \\\”:45,\\\ “preload_min_step \\\”:5,\\\ “preload_max_step \\\”:10 ,\\\ “encryption_key \\\”:\\\ “\\\”,\\\ “player_access_key \\\”:\\\ “\\\”},\\\ “video_3 \\\”: {\\\ “的定義\\\”:\\\ “720P \\\”,\\\”V型\\\ “:\\\” MP4 \\\”,\\\ “vwidth \\\”:1280,\\\ “vheight \\\”:720,\\\ “位元率\\\”: 505355,\\\ “logo_type \\\”:\\\ “xigua \\\”,\\\ “codec_type \\\”:\\\ “H264 \\\”,\\\“大小\\\ “:8743381,\\\” main_url \\\ “:\\\” aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMmU2MzA3MmY4OTNkOTY5YzA4OGY5NDMwOWMwNjExNmQvNWFlMmZjN2MvdmlkZW8vbS8yMjAxOTlmODc1MzBmNjU0YWI1YTA4ZmNiOTVjYmRmYjMwNDExNTQ0MmNkMDAwMDE4OGY5YWZlYjlkOC8 = \\\”,\\\ “backup_url_1 \\\”:\\\ “aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9jMTM3MDVkZWQ5YTE5M2EzNWM4MmUxM2UyNzk5YWI2Zi81YWUyZmM3Yy92aWRlby9tLzIyMDE5OWY4NzUzMGY2NTRhYjVhMDhmY2I5NWNiZGZiMzA0MTE1NDQyY2QwMDAwMTg4ZjlhZmViOWQ4Lw == \\\”,\\\ “main_http_url \\\”:\\\”aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMmU2MzA3MmY4OTNkOTY5YzA4OGY5NDMwOWMwNjExNmQvNWFlMmZjN2MvdmlkZW8vbS8yMjAxOTlmODc1MzBmNjU0YWI1YTA4ZmNiOTVjYmRmYjMwNDExNTQ0MmNkMDAwMDE4OGY5YWZlYjlkOC8 = \\\”,\\\ “backup_http_url \\\”:\\\ “aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9jMTM3MDVkZWQ5YTE5M2EzNWM4MmUxM2UyNzk5YWI2Zi81YWUyZmM3Yy92aWRlby9tLzIyMDE5OWY4NzUzMGY2NTRhYjVhMDhmY2I5NWNiZGZiMzA0MTE1NDQyY2QwMDAwMTg4ZjlhZmViOWQ4Lw == \\\”,\\\ “user_video_proxy \\\”:1,\\\ “socket_buffer \\\” :11370420,\\\ “preload_size \\\”:327680,\\\ “preload_interval \\\”:45,\\\ “preload_min_step \\\”:5,\\\ “preload_max_step \\\”:10 ,\\\ “encryption_key \\\”:\\\ “\\\”,\\\ “player_access_key \\\”:\\\ “\\\”}},\\\ “dns_info \\\” :{}} \ “\ ”video_style \“:8}”
找到:
\\\"main_url\\\":\\\"aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vYTZhOWJlOGJlYWJlNGZhYTEzZTVjYmIxOGY0NDBkY2IvNWFlMmZjN2MvdmlkZW8vbS8yMjBmMjc1MGYwZjQ5ZmM0NGY1YjBhMzIyZmRiZDMzYzFiZTExNTNmZjdiMDAwMTExM2Q0OWY2OGUwYS8=\\\",\\\"backup_url_1\\\":\\\"aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS84ODY1NGJhZDBhYzU1MzAwMzJjYjk0ZmZhMmIyMWNhNS81YWUyZmM3Yy92aWRlby9tLzIyMGYyNzUwZjBmNDlmYzQ0ZjViMGEzMjJmZGJkMzNjMWJlMTE1M2ZmN2IwMDAxMTEzZDQ5ZjY4ZTBhLw==\\\",\\\"main_http_url\\\":\\\"aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vYTZhOWJlOGJlYWJlNGZhYTEzZTVjYmIxOGY0NDBkY2IvNWFlMmZjN2MvdmlkZW8vbS8yMjBmMjc1MGYwZjQ5ZmM0NGY1YjBhMzIyZmRiZDMzYzFiZTExNTNmZjdiMDAwMTExM2Q0OWY2OGUwYS8=\\\",\\\"backup_http_url\\\":\\\"aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS84ODY1NGJhZDBhYzU1MzAwMzJjYjk0ZmZhMmIyMWNhNS81YWUyZmM3Yy92aWRlby9tLzIyMGYyNzUwZjBmNDlmYzQ0ZjViMGEzMjJmZGJkMzNjMWJlMTE1M2ZmN2IwMDAxMTEzZDQ5ZjY4ZTBhLw==\\\",\\\"user_video_proxy\\\":1,\\\"socket_buffer\\\":3457260,\\\"preload_size\\\":327680,\\\"preload_interval\\\":45,\\\"preload_min_step\\\":5,\\\"preload_max_step\\\":10,\\\"encryption_key\\\":\\\"\\\",\\\"player_access_key\\\":\\\"\\\"},\\\"video_2\\\":{\\\"definition\\\":\\\"480p\\\",\\\"vtype\\\":\\\"mp4\\\",\\\"vwidth\\\":854,\\\"vheight\\\":480,\\\"bitrate\\\":236403,\\\"logo_type\\\":\\\"xigua\\\",\\\"codec_type\\\":\\\"h264\\\",\\\"size\\\":4644300,\\\"main_url\\\":\\\"aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMDE1MTRlNDM0YzU0ZGJlOWY4YzcxODFjOTUwYTA5MmYvNWFlMmZjN2MvdmlkZW8vbS8yMjA3YjFlMTE5ZjdkZjY0Mjg2YTI0YjhhZDcyMGZhYWM0YjExNTNlZTc1MDAwMTIzYjA0NDY2ZDczZC8=\\\",\\\"backup_url_1\\\":\\\"aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9mMTg5NDAwNzY3NzhiMjlmMzkzNzNmZDA5ZGNhNzZkMC81YWUyZmM3Yy92aWRlby9tLzIyMDdiMWUxMTlmN2RmNjQyODZhMjRiOGFkNzIwZmFhYzRiMTE1M2VlNzUwMDAxMjNiMDQ0NjZkNzNkLw==\\\",\\\"main_http_url\\\":\\\"aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMDE1MTRlNDM0YzU0ZGJlOWY4YzcxODFjOTUwYTA5MmYvNWFlMmZjN2MvdmlkZW8vbS8yMjA3YjFlMTE5ZjdkZjY0Mjg2YTI0YjhhZDcyMGZhYWM0YjExNTNlZTc1MDAwMTIzYjA0NDY2ZDczZC8=\\\",\\\"backup_http_url\\\":\\\"aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9mMTg5NDAwNzY3NzhiMjlmMzkzNzNmZDA5ZGNhNzZkMC81YWUyZmM3Yy92aWRlby9tLzIyMDdiMWUxMTlmN2RmNjQyODZhMjRiOGFkNzIwZmFhYzRiMTE1M2VlNzUwMDAxMjNiMDQ0NjZkNzNkLw==\\\",\\\"user_video_proxy\\\":1,\\\"socket_buffer\\\":5319000,\\\"preload_size\\\":327680,\\\"preload_interval\\\":45,\\\"preload_min_step\\\":5,\\\"preload_max_step\\\":10,\\\"encryption_key\\\":\\\"\\\",\\\"player_access_key\\\":\\\"\\\"},\\\"video_3\\\":{\\\"definition\\\":\\\"720p\\\",\\\"vtype\\\":\\\"mp4\\\",\\\"vwidth\\\":1280,\\\"vheight\\\":720,\\\"bitrate\\\":505355,\\\"logo_type\\\":\\\"xigua\\\",\\\"codec_type\\\":\\\"h264\\\",\\\"size\\\":8743381,\\\"main_url\\\":\\\"aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMmU2MzA3MmY4OTNkOTY5YzA4OGY5NDMwOWMwNjExNmQvNWFlMmZjN2MvdmlkZW8vbS8yMjAxOTlmODc1MzBmNjU0YWI1YTA4ZmNiOTVjYmRmYjMwNDExNTQ0MmNkMDAwMDE4OGY5YWZlYjlkOC8=\\\",\\\"backup_url_1\\\":\\\"aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9jMTM3MDVkZWQ5YTE5M2EzNWM4MmUxM2UyNzk5YWI2Zi81YWUyZmM3Yy92aWRlby9tLzIyMDE5OWY4NzUzMGY2NTRhYjVhMDhmY2I5NWNiZGZiMzA0MTE1NDQyY2QwMDAwMTg4ZjlhZmViOWQ4Lw==\\\",\\\"main_http_url\\\":\\\"aHR0cDovL3YzLXR0Lml4aWd1YS5jb20vMmU2MzA3MmY4OTNkOTY5YzA4OGY5NDMwOWMwNjExNmQvNWFlMmZjN2MvdmlkZW8vbS8yMjAxOTlmODc1MzBmNjU0YWI1YTA4ZmNiOTVjYmRmYjMwNDExNTQ0MmNkMDAwMDE4OGY5YWZlYjlkOC8=\\\",\\\"backup_http_url\\\":\\\"aHR0cDovL3YxLXR0Lml4aWd1YXZpZGVvLmNvbS9jMTM3MDVkZWQ5YTE5M2EzNWM4MmUxM2UyNzk5YWI2Zi81YWUyZmM3Yy92aWRlby9tLzIyMDE5OWY4NzUzMGY2NTRhYjVhMDhmY2I5NWNiZGZiMzA0MTE1NDQyY2QwMDAwMTg4ZjlhZmViOWQ4Lw==\\\",\\\"user_video_proxy\\\":1,\\\"socket_buffer\\\":11370420,\\\"preload_size\\\":327680,\\\"preload_interval\\\":45,\\\"preload_min_step\\\":5,\\\"preload_max_step\\\":10,\\\"encryption_key\\\":\\\"\\\",\\\"player_access_key\\\":\\\"\\\"}},\\\"dns_info\\\":{}}\",\"video_style\":8}"
這樣的值。沒錯,這就是真實地址..只不過是經過BASE64加密換了面孔而已。
當然...你想獲取360p,480p,720p三種格式的資料。只要拿到列表頁的video_id通過url地址拼接也可以的。加密方法也很簡單,crc32加密,引數取正直。不過目測只有我自己用得上。上傳程式碼。害怕忘了...
匯入隨機,請求,json,base64
來自urllib匯入分析
匯入binascii
#1 -------解析出真實視訊資訊
def get_video_info(id):
“”“獲取視訊資訊”“”
#id ='6b489ab9a6944d289d1cae61d2042d4f'#獲取視訊的video_id
隨機生成的值變成整數
url ='http://i.snssdk.com/video/urls/v/1/toutiao/mp4/%s'%id#視訊地址拼接
n = parse.urlparse(url).path +'?r =%s'%p
c = binascii.crc32(n.encode('utf-8'))#編碼獲取crc32值
s = right_shift(c,0)
#如果c的值long型,加2的32次方取n的商,作用是取正直
#如果c的值大於等於0,取n的商
return url +'?r =%s&s =%s'%(p,s)
def right_shift(val,n):
列印(val + 0x100000000)
如果val> = 0,則返回val >> n else(val + 0x100000000)>> n
#2 --------獲取三種格式視訊地址(360p,480p,720p)
def get_video(url):
res = requests.get(url)#data為空,預設使用get
res = res.content.decode('utf-8')
resp = json.loads(res)
video_url = base64.b64decode(resp [“data”] [“video_list”] [“video_1”] [“main_url”])。decode()
列印(VIDEO_URL)
real_url = get_video_info('cf424d580c684435a3241672d9863e02')
get_video(real_url)
只要video_id就能獲取不同格式的視訊地址哦..