抖音web频道爬虫

news2024/11/14 22:41:21

抖音web频道爬虫代码: 

<?php
header('Content-Type:application/json; charset=utf-8');

//抖音频道爬虫

class DouyinChannel{

	private $app_id = 1;
    private $spider_code = 1;
	private $channels = [
		[
			"channel_name" => "热点",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/hotspot?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=&count=10&Seo-Flag=0&channel_id=99&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=huib7ZvPSFnE4D21P0L4qs2FG-jHNDkdgUUQ9W2nfepyhx8yE_7LJWZcnAvdx11Ff1DyBzsQ3ysADZRbco8fyGZcXrix0kDFwX-XfqnMoqBNjwJSOZm4fccdH2EKHcxj",
				"referer: https://www.douyin.com/hot",
			],
		],
		[
			"channel_name" => "游戏",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300205&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=huib7ZvPSFnE4D21P0L4qs2FG-jHNDkdgUUQ9W2nfepyhx8yE_7LJWZcnAvdx11Ff1DyBzsQ3ysADZRbco8fyGZcXrix0kDFwX-XfqnMoqBNjwJSOZm4fccdH2EKHcxj&X-Bogus=DFSzswVLd2kANy39tr8Aab0y3xSP",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=huib7ZvPSFnE4D21P0L4qs2FG-jHNDkdgUUQ9W2nfepyhx8yE_7LJWZcnAvdx11Ff1DyBzsQ3ysADZRbco8fyGZcXrix0kDFwX-XfqnMoqBNjwJSOZm4fccdH2EKHcxj",
				"referer: https://www.douyin.com/channel/300205",
			],
		],
		[
			"channel_name" => "娱乐",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300201&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=huib7ZvPSFnE4D21P0L4qs2FG-jHNDkdgUUQ9W2nfepyhx8yE_7LJWZcnAvdx11Ff1DyBzsQ3ysADZRbco8fyGZcXrix0kDFwX-XfqnMoqBNjwJSOZm4fccdH2EKHcxj&X-Bogus=DFSzswVLr4sANy39tr8AFx0y3xt0",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=huib7ZvPSFnE4D21P0L4qs2FG-jHNDkdgUUQ9W2nfepyhx8yE_7LJWZcnAvdx11Ff1DyBzsQ3ysADZRbco8fyGZcXrix0kDFwX-XfqnMoqBNjwJSOZm4fccdH2EKHcxj",
				"referer: https://www.douyin.com/channel/300201",
			],
		],
		[
			"channel_name" => "二次元",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300206&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q&X-Bogus=DFSzswVL1R2ANy39tr8Abh0y3xS3",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q",
				"referer: https://www.douyin.com/channel/300206",
			],
		],
		[
			"channel_name" => "音乐",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300209&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q&X-Bogus=DFSzswVLUgsANy39tr8lfx0y3xSY",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q",
				"referer: https://www.douyin.com/channel/300209",
			],
		],
		[
			"channel_name" => "美食",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300204&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q&X-Bogus=DFSzswVLDk0ANy39tr8l/X0y3xtH",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q",
				"referer: https://www.douyin.com/channel/300204",
			],
		],
		[
			"channel_name" => "体育",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300207&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q&X-Bogus=DFSzswVLO62ANy39tr8lGX0y3xt1",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q",
				"referer: https://www.douyin.com/channel/300207",
			],
		],
		[
			"channel_name" => "时尚",
			"url" => "https://www.douyin.com/aweme/v1/web/channel/feed/?device_platform=webapp&aid=6383&channel=channel_pc_web&tag_id=300208&count=10&Seo-Flag=0&refresh_index=1&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1884&screen_height=948&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=109.0.0.0&browser_online=true&engine_name=Blink&engine_version=109.0.0.0&os_name=Windows&os_version=10&cpu_core_num=4&device_memory=4&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7243977696307693095&msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q&X-Bogus=DFSzswVLL1sANy39tr8lHb0y3xtE",
			"header" => [
				"cookie: __ac_signature=_02B4Z6wo00f016i1k6gAAIDBkxcMJA2vbNOolZcAAI6z7f; ttwid=1%7CMNfe3_d2l2GVFMOuF1o_ExtdJyCFoc7BjEWpPZKGbPE%7C1686620010%7C0d262fa8d515b271671ffb936a2aa6bb3096822d976caec31ab9d99cd0950202; strategyABtestKey=%221686620015.732%22; passport_csrf_token=3c1829466163403e5c5acedcde52a2c2; passport_csrf_token_default=3c1829466163403e5c5acedcde52a2c2; __bd_ticket_guard_local_probe=1686620019170; s_v_web_id=verify_litm0fx8_IJvr9ykf_HPU6_4Kf6_8WtH_8G1VFuBgfldR; ttcid=a043088ce0d745939ec69fdd23af66d018; __security_s_sdk_crypt_sdk=1; bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtY2xpZW50LWNzciI6Ii0tLS0tQkVHSU4gQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbk1JSUJEakNCdFFJQkFEQW5NUXN3Q1FZRFZRUUdFd0pEVGpFWU1CWUdBMVVFQXd3UFltUmZkR2xqYTJWMFgyZDFcclxuWVhKa01Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUJzNFBnaExpdmJ3VmRCTkZORS9VZjZCMFxyXG43MmNpQ1JFOXVEeE5OVEVjRGMxRFl0MGJqUHQyVkpndktJdTMrZUlwbkZ6b1dYM0VKODI5bDdCRVd2NXU5NkFzXHJcbk1Db0dDU3FHU0liM0RRRUpEakVkTUJzd0dRWURWUjBSQkJJd0VJSU9kM2QzTG1SdmRYbHBiaTVqYjIwd0NnWUlcclxuS29aSXpqMEVBd0lEU0FBd1JRSWhBUDJuK2FCbmVjdVdweDhJTHhjTkhMMWdhZXpHTXJQN1BIc01JQkx1eUxmZlxyXG5BaUEzelJ1VjZEUE9yayt5ek5jeklNWWxZTU9XR2dMNEYyYS9LUkFIZ0t2azV3PT1cclxuLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tXHJcbiJ9; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; douyin.com; device_web_cpu_core=4; device_web_memory_size=4; webcast_local_quality=null; xgplayer_user_id=36785983609; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1687228909464%2C%22type%22%3A1%7D; msToken=nyZ17qTjxoDbym5lzfXxLzxVdOMyQftOpZXduqiuaAosnYkimL3-gEZJdHANwpYqEAJw4nGgKpcAvTDmxLjbdoKstha8mFO0cryaqk7cpDj2Phq7XzL7XoXKUhN5u9O0; home_can_add_dy_2_desktop=%221%22; tt_scid=8qolBqy84zMs73hlB5xH91-Z971QHft2PM834imJxruzn248-v14F3TgK-jZO-Op6d21; download_guide=%223%2F20230613%2F0%22; pwa2=%223%7C0%22; msToken=Vsrgr2oaDqCNYYgq_5TU9KulzUZcTADeOfJjWKtMkWCuoLFGi05f7iLyOGmtVehVu2Gy0A8TC8_o62zdQpmyQ1hCWnZySUVzzGh4UlA_HWZM7Vgj3CJnUAjF8HpKk_5q",
				"referer: https://www.douyin.com/channel/300208",
			],
		]
	];

	public function run(){

		$channels = $this->channels;
		foreach($channels as $val){
			echo "=========== 频道:".$val["channel_name"].PHP_EOL;
			$this->doChannel($val);
			sleep(3);
		}
	}

	public function doChannel($channel){

		$url = $channel["url"];
		$header = $channel["header"];
		$result = $this->curlGet($url, $header);
		$resultArr = json_decode($result, true);
		if(!isset($resultArr["aweme_list"]) || empty($resultArr["aweme_list"])){
			echo "====== 未获取到数据,等待8到10s".PHP_EOL;
			sleep(rand(8, 10));
			return false;
		}

		foreach($resultArr['aweme_list'] as $article){
			
        	echo date("m-d H:i:s",time())."------【{$article['aweme_id']}|".date('Y-m-d H:i:s', $article['create_time'])."】{".trim($this->filterEmoji($article['desc']))."}".PHP_EOL;
		}
				
	}

	private function curlGet($url, $header = []) {

	     $headers = array(
            'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36',
    	);

        $headers = array_merge($headers, $header);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_TIMEOUT, 20);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);

        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            echo 'Error:' . curl_error($ch);
        }
        curl_close($ch);
        return $result;
    }

    //过滤emoji表情
	private function filterEmoji($str)
	{
	    $str = preg_replace_callback('/./u',
	            function (array $match) {
	        return strlen($match[0]) >= 4 ? '' : $match[0];
	    }, $str);
	    return $str;
	}
}

$douyin = new DouyinChannel();
$douyin->run();

运行结果演示: 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/930215.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java实现自定义注解

前言 &#xff08;1&#xff09;Java实现自定义注解其实很简单&#xff0c;跟类定义差不多&#xff0c;只是属性的定义可能跟我们平时定义的属性略有不同&#xff0c;这里会给大家详解&#xff0c;先来看代码&#xff1a; Target(ElementType.FIELD) Retention(RetentionPoli…

iOS App的设计规范

iOS App 的设计规范是苹果公司为开发人员和设计师提供的一系列准则和建议&#xff0c;旨在确保应用在 iOS 设备上的外观、交互和用户体验保持一致。以下是一些常见的 iOS App 设计规范要点&#xff0c;希望对大家有所帮助。北京木奇移动技术有限公司&#xff0c;专业的软件外包…

LEADTOOLS V22 for Python -Crack

LEAD Technologies Inc 是面向所有主要平台和编程语言的应用程序开发的人工智能 SDK 的领先提供商&#xff0c;很高兴地宣布在其最新的 LEADTOOLS 版本 22 更新中添加了完整的 Python 支持。 Python是一种动态的高级编程语言&#xff0c;广泛应用于科学计算、数据分析、人工智…

似懂非懂的 AspectJ

今天想和小伙伴们聊一下我们在使用 Spring AOP 时&#xff0c;一个非常常见的概念 AspectJ。 1. 关于代理 小伙伴们知道&#xff0c;Java 23 种设计模式中有一种模式叫做代理模式&#xff0c;这种代理我们可以将之称为静态代理&#xff0c;Spring AOP 我们常说是一种动态代理…

R语言常用基本函数,含实例:万字总结

目录 vector:创建向量&#xff08;默认填充0&#xff0c;空字符&#xff0c;FALSE&#xff09; data.frame :可以看作由多个向量组成的表格&#xff0c;每个向量代表表格的一列数据 sequence:创建序列(可以简写为seq) dim:获取矩阵或数组的维度信息 length subset&#x…

优思学院|传统流水线生产与单元式生产的差异与优势对比

在制造业领域&#xff0c;生产方式的选择对于生产效率和产品质量至关重要。传统流水线生产和精益生产中的单元式生产是两种常见的生产模式&#xff0c;它们在工作方式、优势以及适用情境上存在着显著的差异。本文将对传统流水线生产和单元式生产进行比较&#xff0c;并探讨它们…

“探索Spring与MyBatis集成的最佳实践与技巧“

目录 引言&#xff1a;1.Spring与MyBatis集成的基本配置2.Spring aop集成pagehelper插件总结附带内容&#xff1a; 引言&#xff1a; 在现代的软件开发中&#xff0c;Spring和MyBatis是两个非常流行的框架。Spring提供了强大的依赖注入和面向切面编程的功能&#xff0c;而MyBa…

炫酷前端页面,鼠标点击特效

最近发现了两个好看的鼠标点击特效&#xff0c;收藏起来用作学习使用&#xff0c;以及更方便的利用 一、鼠标点击弹出爱心 效果图 html源码如下&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><m…

应知道的python基础知识

1、运算符 2、特殊情况下的逻辑运算 3、循环中的else 3.1 while else 3.2 for else 4、列表相关操作 列表的相关操作 4.1增(append, extend, insert) 通过append可以向列表添加元素:列表.append(新元素数据)通过extend可以将另一个列表中的元素逐一添加到列表中:列表.exte…

【推荐】Spring与Mybatis集成

目录 1.概述 2.集成 2.1代码演示&#xff1a; 3.整合 3.1概述 3.2 进行整合分页 接着上两篇&#xff0c;我已经写了Mybatis动态之灵活使用&#xff0c;mybatis的分页和特殊字符的使用方式接下来把它们集成起来&#xff0c;是如何的呢&#x1f447;&#x1f447;&#x1…

深入理解linux内核--系统启动

史前时代&#xff1a;BIOS 计算机在加电的那一刻几乎是毫无用处的&#xff0c;因为RAM芯片中包含的是随机数据&#xff0c;此时还没有操作系统在运行。 在开始启动时&#xff0c;有一个特殊的硬件电路在CPU的一个引脚上产生一个RESET逻辑值。 在RESET产生以后&#xff0c;就把…

pytorch学习(7)——神经网络优化器torch.optim

1 optim 优化器 PyTorch神经网络优化器&#xff08;optimizer&#xff09;通过调整神经网络的参数&#xff08;weight和bias&#xff09;来最小化损失函数&#xff08;Loss&#xff09;。 学习链接&#xff1a; https://pytorch.org/docs/stable/optim.html 1.1 优化器基类 使…

Wlan——无线桥接的基本概念及配置

目录 WDS无线分布式系统 WDS组网拓扑 中继桥接 一对一桥接 一对多桥接 多跳桥接 锐捷无线桥接的配置 根桥的配置(瘦AP是在AC上配置) 非根桥的配置&#xff08;直接在AP上配置&#xff09; WDS无线分布式系统 WDS指AP之间通过无线链路连接两个或多个独立的局域网&…

picGo+gitee+typora设置图床

picGogiteetypora设置图床 picGogitee设置图床下载picGo软件安装picGo软件gitee操作在gitee中创建仓库在gitee中配置私人令牌 配置picGo在插件设置中搜索gitee插件并进行下载 TyporapicGo设置Typora 下载Typora进行图像设置 picGogitee设置图床 当我了解picGogitee可以设置图床…

每日两题 129求根节点到叶节点数字之和 257二叉树的所有路径

129 题目 给你一个二叉树的根节点 root &#xff0c;树中每个节点都存放有一个 0 到 9 之间的数字。 每条从根节点到叶节点的路径都代表一个数字&#xff1a; 例如&#xff0c;从根节点到叶节点的路径 1 -> 2 -> 3 表示数字 123 。 计算从根节点到叶节点生成的 所有…

pytestx容器化执行引擎

系统架构 前端、后端、pytest均以Docker容器运行服务&#xff0c;单独的容器化执行引擎&#xff0c;项目环境隔离&#xff0c;即用即取&#xff0c;用完即齐&#xff0c;简单&#xff0c;高效。 前端容器&#xff1a;页面交互&#xff0c;请求后端&#xff0c;展示HTML报告 后…

2023-8-25食物链

题目链接&#xff1a;食物链 #include <iostream>using namespace std;const int N 50010;int n, m; int p[N], d[N];int find(int x) {if(p[x] ! x){int t find(p[x]);d[x] d[p[x]];p[x] t;}return p[x]; }int main() {cin >> n >> m;for(int i 1; i…

Could not initialize class net.sf.cglib.beans.BeanMap$Generator异常解决

目录 前言 解决方法 复盘分析 前言 使用easyexcel时&#xff0c;研发环境正常, 服务器编译正常, EasyExcel调用方法的时候, 服务器出现Could not initialize class net.sf.cglib.beans.BeanMap$Generator问题。 报错信息 com.alibaba.excel.exception.ExcelAnalysisExc…

​LeetCode解法汇总2236. 判断根结点是否等于子结点之和

目录链接&#xff1a; 力扣编程题-解法汇总_分享记录-CSDN博客 GitHub同步刷题项目&#xff1a; https://github.com/September26/java-algorithms 原题链接&#xff1a;力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成长平台 描述&#xff1a; 给你一个 …

帆软报表系统查看数据库密码

有子曰&#xff1a;“礼之用&#xff0c;和为贵。先王之道&#xff0c;斯为美。小大由之。有所不行&#xff0c;知和而和&#xff0c;不以礼节之&#xff0c;亦不可行也。” 查看数据库密码 构造payload&#xff0c;访问漏洞url&#xff1a; /ReportServer?opfr_server&…