爬取学习强国视频小示例

  • 因为需要爬取的视频数量并不是很大,总共需要将131个视频下载下来,所以就直接去手动找找视频的地址和名称保存下来的。
  • 由于页面是动态加载的,所以我们无法在网站源码中直接找到视频的超链接。设想是可以用Selenium模拟浏览器点击进行动态加载获取视频链接和标题的,不过很久没有用Selenium了,就图简单偷点懒啦。
  • 所以以下代码就是用requests去直接请求mp4地址得到批量下载的结果的。
    在这里插入图片描述
    参考:https://zhuanlan.zhihu.com/p/132703833
# https://article.xuexi.cn/articles/video/index.html?art_id=294702920556063797
import requests
import os


def download_mp4_by_url(url, name, n):
    """
    通过链接下载视频链接下载相应的mp4视频。
    :param url: mp4视频超链接。
    :param name: 视频保存的主题名
    :param n: 视频的顺序编号
    :return:
    """
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"
    }
    video_data = requests.get(url, headers=headers).content
    if not os.path.exists("./视频"):
        os.mkdir("./视频")
    with open(f"./视频/{n}.{name}.mp4", "wb") as f:
        f.write(video_data)
        print(f"正在下载第{n}个视频:{name}")


def main():
    urlstr = """https://boot-video.xuexi.cn/video/1006/p/5fd0919e562a1eedd1a8f740849f491a-72ee9dcf0fa440d7b8974dbea2538d39-2.mp4,https://boot-video.xuexi.cn/video/1006/p/29057017b697b69ba089b141ffa7155b-72dba5794ada485fa36916ca6c4bb276-2.mp4,https://boot-video.xuexi.cn/video/1006/p/7556c7043e88186b0bfb60a1abe27481-610517fe75974eef92edaf44fd579853-2.mp4,https://boot-video.xuexi.cn/video/1006/p/6cf3b6826f95653511f5dd8ea42b95c9-ff6425a5b1db4fc9b406c42480ebaae4-2.mp4,https://boot-video.xuexi.cn/video/1006/p/dca2b2122efa84ef43c0cf3c05b728d4-60f0576258944bea936d0aea6d9e9e50-2.mp4,https://boot-video.xuexi.cn/video/1006/p/e7c7db360b47191742ef7266aa509573-11044cf3d6d643619924122f2374bf2b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/ae79b9d0c3391a1380a866a9ce2c781a-e5b2e7be528e4d59802175f2d74af5a9-2.mp4,https://boot-video.xuexi.cn/video/1006/p/d3e06265dadc66fd354649793d8aa75e-da7788f2a0984b87b67ff1d6f3e6d6a7-2.mp4,https://boot-video.xuexi.cn/video/1006/p/5613cceb7b31f3eefb8d3c1d1279be47-b9f0d1d881474f16a057c049056daa3b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/0a3767c3924b2d0dc29b8e9c802a81da-46e9198132224d58a79abaf184b39c39-2.mp4,https://boot-video.xuexi.cn/video/1006/p/f5337dcf1029d1755d15b39e1bb34733-2a696096f6614b1780858c64ce8a29c5-2.mp4,https://boot-video.xuexi.cn/video/1006/p/fa1beb92f52913d5d0502e3fa5f096d5-1e0f65c5f8c8406eb34b6210670033c9-2.mp4,https://boot-video.xuexi.cn/video/1006/p/38566457defcadd3b6d9132a38d6ab29-0b349aaffb9c496287f4e1ef64876e86-2.mp4,https://boot-video.xuexi.cn/video/1006/p/5f8b2eb6b9dea34354d05d67f1882ada-b8ec6f074f064290a1182c6ccdae7eba-2.mp4,https://boot-video.xuexi.cn/video/1006/p/731132a6d4d87f7b9e0b9a94a65a5a06-dcf3f148b0c04724b320c7956caedf86-2.mp4,https://boot-video.xuexi.cn/video/1006/p/03a8ba3d09d1c4753546f5b3550a9251-8cec7ba4c26f4bc2bc7a6540cfb0fc7b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/77cdb7969c3fef76cb1615f3c0718a46-5b6cccd988bb40a9a4fdc271061a336f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/527970e4c8030524654803d3d159dbc8-6286fef291be46d5af41900f6988d1d4-2.mp4,https://boot-video.xuexi.cn/video/1006/p/1d6d6e6abd84ceb6368f039aa086a01c-a37df97a4cdf4212ab1982ce7dae1ab7-2.mp4,https://boot-video.xuexi.cn/video/1006/p/af756c8900e9c9b6b54412abb39be9ab-e37dd2b6537846b3a916e35d5dd99b52-2.mp4,https://boot-video.xuexi.cn/video/1006/p/271c0ec735a04cc00b9d13986d7cd65b-83c9c880f0bb4f07a103693f34aa9a95-2.mp4,https://boot-video.xuexi.cn/video/1006/p/29beed2e15abfbe3ba457a6a8d1d1c9c-660da4a738354dd09325aecfab268a43-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a421df188b71340d3d0fee3a1e19fe14-d12daf58c6b24a14b46e6c7e5dc191ea-2.mp4,https://boot-video.xuexi.cn/video/1006/p/2771da94f2ce433a17ff61f8b870bb56-7fe1239fec054348ab1a281616bc146c-2.mp4,https://boot-video.xuexi.cn/video/1006/p/0fde550a85cca3c08a8c1356e21b760b-6be5b3e2d1a34fbd84f69dc955ace72d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/418eb399a3e67bce6ef6748e848107a2-24b9382f5fa94b23ba09477508ba574f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/f82578fa00d98c2d5369661b4a833d70-ef9baf0d218f4bebb25d7ed57db15451-2.mp4,https://boot-video.xuexi.cn/video/1006/p/42466a20053129df040b6dc39af56318-376df6c52bd940229b22aeab66273800-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a153916e82b6c2b0c839dffbba49dec8-721d3890f73c404996508806848fd353-2.mp4,https://boot-video.xuexi.cn/video/1006/p/6d992bc4a29759ca59c0271ef82c95a8-8c120ce367e34ef799868ba1d0446180-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a1a44024fd503a83381f7d8d617f7a5b-79d8b33098b4415db91cfd1ccfdad1f0-2.mp4,https://boot-video.xuexi.cn/video/1006/p/bc811f4dca003b28fd650b1d49c5ba0e-6e443a4230014feb954822a7d68e0c85-2.mp4,https://boot-video.xuexi.cn/video/1006/p/af274d40ddaa2f92d813d5cb6929e4ce-0f11ba22431c49b18701bbc69c300058-2.mp4,https://boot-video.xuexi.cn/video/1006/p/41ff8cabc43fb9bc03ce7fcc0b00eab3-eddc63b4e0e54c2bbede9ed5f02f73be-2.mp4,https://boot-video.xuexi.cn/video/1006/p/8fa92f5e955de50dad8f5e6cd6d9f7ef-30147986d805487f897295f5f13cd13b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/e643da5bde09e6cd536b19ba755063cc-c54a968d54b7401484d85c2c78920e8f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/0a2edf04db75c690a612e5447ee5a070-f907ddf5c87e4456b1a9dc84d79ea3dd-2.mp4,https://boot-video.xuexi.cn/video/1006/p/5e0d7314991de52da8d5b1567813512d-3398307fc32f42cc977f8133f803b76f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/89dd21b2a52faa3c0b75ac1fca03b7cf-745f01a55bc544c4a62464b6e99903d8-2.mp4,https://boot-video.xuexi.cn/video/1006/p/bb9d200a5ed90d19a34265d0f74fe6cf-e6bd05f32ba143e8a40d71d9667e740b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/957e47de4370b3c73c065bd802c52c01-c9d90b11e50f43bf9de79fa56679784c-2.mp4,https://boot-video.xuexi.cn/video/1006/p/cfaf1576ba3b1df2fb8d1b4cfab5d26f-b2e0841da56940a7ad56340633fc6471-2.mp4,https://boot-video.xuexi.cn/video/1006/p/dba15bb80b59fbe6ab95f7360d67bc11-804eb20577ab4877bd7cda30d119ac3e-2.mp4,https://boot-video.xuexi.cn/video/1006/p/8f6d37ca8d45421b468617407df5c95f-37ee2e67fbec4a47844ec3e1ad6f6040-2.mp4,https://boot-video.xuexi.cn/video/1006/p/31176f17aeb61a6d32f960f4bd4a0686-8429f54b53f04a00b24c0bbe2817a686-2.mp4,https://boot-video.xuexi.cn/video/1006/p/5eddff452cad6fe4297e89057799e6bb-3a20a92776334dd08b7b12b5befeaf42-2.mp4,https://boot-video.xuexi.cn/video/1006/p/4aa35925803a1693b35f33736f90dd25-a29d01ca9e7440778fe1b40d78734415-2.mp4,https://boot-video.xuexi.cn/video/1006/p/d29e527934c0556141964732ff3220a1-0ec288d0ddbd44d09cd216678d791933-2.mp4,https://boot-video.xuexi.cn/video/1006/p/0b46fda6f873b0623dd981e157f7e014-acb282c7a3cd477fb72b062227815890-2.mp4,https://boot-video.xuexi.cn/video/1006/p/9f6164c2950b2d37e816fbd7c8c49347-716d290572d84d98ad301c07c17de5cb-2.mp4,https://boot-video.xuexi.cn/video/1006/p/986491bd130e85fddc048eb759cec2fd-56620b7bd08d4ee491db3aa5e7b283e2-2.mp4,https://boot-video.xuexi.cn/video/1006/p/56054bf540fa797e71e3f866c24a09ce-8e9cbf1476ef4dca9b6a7d3bdbfaaf90-2.mp4,https://boot-video.xuexi.cn/video/1006/p/2c7adba23f684e661a7a72766c8a9c17-d734f23b6cbb4ac58dc65ed0cfb42568-2.mp4,https://boot-video.xuexi.cn/video/1006/p/631cb0e564b1944c9ecd957c34a57e88-7c10d4b506d84a8eb03e65b18375ef38-2.mp4,https://boot-video.xuexi.cn/video/1006/p/43ea00ebb945581bf72cde9ca89f2da6-08b1848464374392841074537a34b02d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/46bfe422e70f5d28e248f9ab0d121c38-3e07163b3488418d9ac47fc1798b6bf6-2.mp4,https://boot-video.xuexi.cn/video/1006/p/83f771f0bd7369059b77c3b56ccf7664-9fc2cb92c367485887ea27da8aca904e-2.mp4,https://boot-video.xuexi.cn/video/1006/p/2ee715f21f61106f83e4f901426f136c-1e928dd5f7894ec98cf01123cecd0cab-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a21341b0f5365a32fb8ae2313ae4fc7f-70ec698a68504d74ac87ef4d85f2dec9-2.mp4,https://boot-video.xuexi.cn/video/1006/p/6d3df788e997368bf7163d0dea38acae-0a23ca135101497f931409eed598b5b1-2.mp4,https://boot-video.xuexi.cn/video/1006/p/83ff2a8a6450a5983469c043dfd2ab9b-a03cf7420bf14e809c3501c9cba48cc6-2.mp4,https://boot-video.xuexi.cn/video/1006/p/52c48538b7008cdd480567dea643fa1d-5067f428d79d4758adf6931011a243ec-2.mp4,https://boot-video.xuexi.cn/video/1006/p/6f79a0cd7731e53de00aef3f77b6ba75-1b9f9f0f3318445c8714db7177c75eed-2.mp4,https://boot-video.xuexi.cn/video/1006/p/502ca838457f46985e7d339c9dd94d84-7b79ac473f62441fbc6191ad1c0ed4ef-2.mp4,https://boot-video.xuexi.cn/video/1006/p/f2dfec5d09fd5c3d7b06d65be1afbf44-5124232c0efd41a2b28dd1a5fd991ff9-2.mp4,https://boot-video.xuexi.cn/video/1006/p/29a6bdcbda1d9360fa4c97add1b21258-a6b68866bc8748398a2ac6ff8f1340ad-2.mp4,https://boot-video.xuexi.cn/video/1006/p/1f57dd2a0cf5b7e97e63c6e884087a90-a0a325f1bb2849f5a467bb997bf21878-2.mp4,https://boot-video.xuexi.cn/video/1006/p/70f2c3fb09c7c798c18ea2e64e64252b-40629663598848f6a5ea55ae7fc95732-2.mp4,https://boot-video.xuexi.cn/video/1006/p/ce6daa2b530771a5f69b207e011e82cb-57309ee44bf944e48a79b9b09c84c758-2.mp4,https://boot-video.xuexi.cn/video/1006/p/4961b8cd99003f6f41382e4ebb89fcef-51bd8225f3b149239c18f6b300b48f0f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/73f29350eb985704089b7b61a6eaf3e4-c7f4b173d8dd4195b61242f14ef15c46-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a219b07be0bc35ff41ad5ebf068dc34f-e6736b582b2b4591aa4f100f8b94b7ab-2.mp4,https://boot-video.xuexi.cn/video/1006/p/410a9f2f0b6192bdbdaa39396221f52c-6852abed973d42349d4c9bedbc550f6b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/2ab710a6ce7ddaf96aa1b28e0cf4f6c3-abcb2769e33347559f5e8d2b286b3dd3-2.mp4,https://boot-video.xuexi.cn/video/1006/p/15f6c34100bf876c7dcc0049592d683e-734f90bde3904afa98580647fdbe398b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/71ce68defb78b286f976b4530a830a6f-98b9f922db814055b52f4a8f9281bafc-2.mp4,https://boot-video.xuexi.cn/video/1006/p/3a2c3bb124c84f6a917db9e048692f70-bbae575fb9ff4eafb32cc78fecd1177d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/af73e42dffa0206148713cd5555eceb7-1c22d2375710400d8e7c3f4071e5e644-2.mp4,https://boot-video.xuexi.cn/video/1006/p/88e36e96e5a09720aae36b67ed7c18f6-767d5dc02b2f46c18c202726bdd3fcee-2.mp4,https://boot-video.xuexi.cn/video/1006/p/8529ebb9aa153b4d04325e8584b1cd44-8cc16ecb8ad2441ebedf9d3cef76ebb5-2.mp4,https://boot-video.xuexi.cn/video/1006/p/4cbcf0776115a5a2409743c6286a7518-19c79ec4844646e78a12066c9d60e56b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/cff211b0944565f0957ce65053239889-f485890a475047eebf81676a914acf96-2.mp4,https://boot-video.xuexi.cn/video/1006/p/649a17f375e581227c785f07f008164b-ff245af5c0b34118b118783865876148-2.mp4,https://boot-video.xuexi.cn/video/1006/p/395bfdbbfa2a13c48b42dffe60a964bb-db31575eb79548f087c8529fe8c57516-2.mp4,https://boot-video.xuexi.cn/video/1006/p/8c52ce19002c1b856d0efdacc1038db8-bc33fa71867440b8a62c34b1f59b4cba-2.mp4,https://boot-video.xuexi.cn/video/1006/p/3d0bfb2473842a295440720e7542bbba-43027d30f1bb49849fadf3f3679f913c-2.mp4,https://boot-video.xuexi.cn/video/1006/p/519b8af4b34e66ae125d551241434a83-eefe47cb08f24a63bf909094014676dd-2.mp4,https://boot-video.xuexi.cn/video/1006/p/fec74636fee82ccf3f47c5a1b96ba3ca-2e0d6d812d994b8693f77c813034ca27-2.mp4,https://boot-video.xuexi.cn/video/1006/p/3ce509ee964328884c429c416316e6eb-6d2ee7402de84677869bd6f44e408e1a-2.mp4,https://boot-video.xuexi.cn/video/1006/p/bd622a6f00cae493ca1205a035c93bf3-7224ed9b66d14cd1bd472637fc454853-2.mp4,https://boot-video.xuexi.cn/video/1006/p/02797843a2932a33e05ab8fa2b554d42-389940076e71460398a864ea6c32570c-2.mp4,https://boot-video.xuexi.cn/video/1006/p/da464b41516e6f53e1958d2f5702f53d-f614569db0f14e0ca1599222c17fb327-2.mp4,https://boot-video.xuexi.cn/video/1006/p/3ec09182194483e86ec42aa9cf5599f2-bdba19cc1ad84deb847bc6f1b70534eb-2.mp4,https://boot-video.xuexi.cn/video/1006/p/7b26c133b0cfca42ecf2ccbbfc36e689-42b9ff237c884d4dbce2a2842c8faf53-2.mp4,https://boot-video.xuexi.cn/video/1006/p/ad2d5062484e74e05641810d06e71c25-879dfddb8e0049c19680ae7bdff7a403-2.mp4,https://boot-video.xuexi.cn/video/1006/p/1cc397e194d914206a193a0dcbaaf649-f91e7a62bbdf4c4eafd27555096644e2-2.mp4,https://boot-video.xuexi.cn/video/1006/p/b0360d98873df7e7854e30e20dabd107-6e2cdd39c434474cbe408bcc4eeb0594-2.mp4,https://boot-video.xuexi.cn/video/1006/p/d5b209f3d6f05c4adbecab5dd415d58a-45c825d86b0640b5a20b445dd9ee1dc2-2.mp4,https://boot-video.xuexi.cn/video/1006/p/98bef60af42e3d6471bf1df948271118-58f6145b62d044fa9b5fa6ab86b64903-2.mp4,https://boot-video.xuexi.cn/video/1006/p/eb44453847aa49b61a174aec80abfc24-c0eb3b0efe794496b46a7fc22c5b969d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/229f90b1ebf77732b3e6b426b82b07c0-92a75187186342d98630cc271b4efe5f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/2be1df82bd23510e11257533486ecd23-77cdbfbe7f104d04acb276c4f6587b78-2.mp4,https://boot-video.xuexi.cn/video/1006/p/c46ee3226a22101331473c2397149c6f-69e2474d16e94f399d21a1d443b7c4c8-2.mp4,https://boot-video.xuexi.cn/video/1006/p/135ff5aba7cd42529db9f43e06149cd0-f6260aafb4514ba3915288e7b8bb2c3d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/e9e0d0dce252ead465243991dead1585-d946b3e7c002413fbcd3f949813a7be4-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a5b6ed955d7769af321c29b33059e545-2ffef5615a69435dbc93b7385072514c-2.mp4,https://boot-video.xuexi.cn/video/1006/p/f71231f0ff95a31d883e7a459d7ac7a5-59d3a7417c3a4671b7e75da2646097a7-2.mp4,https://boot-video.xuexi.cn/video/1006/p/14b972a46469283fe35ab9dc1746ca2e-be534fd49c23443898886d25084a5b24-2.mp4,https://boot-video.xuexi.cn/video/1006/p/aa1c1d3b2055f8e4e8e4bd135e162c0f-76aa004b273f4755a0d7a81fed81cf14-2.mp4,https://boot-video.xuexi.cn/video/1006/p/96ad67bd488fbee5edc05d882e687e46-78719eefb76c4b3d98db80c312e6060f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/23c5b6b4a2a68c2555f4bc742236ca9b-a8298be10a9c4fbaa81c2cea3072932d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/a1675428e11e764fbd1768b7f574b232-b7a9f438df8344f5861864c75e0bc9dd-2.mp4,https://boot-video.xuexi.cn/video/1006/p/e978f876a8417a42b21fdc980aff8925-778554c730d44be98bfe99352328479b-2.mp4,https://boot-video.xuexi.cn/video/1006/p/aac5acc7939a9590043d86be9f069e2d-ee3d8dbccb074707a1abf50ee4ea1cae-2.mp4,https://boot-video.xuexi.cn/video/1006/p/6a8657cc800fcbdebdc8f65864c4ebe4-e581f011019948dc98f37039085fc1b6-2.mp4,https://boot-video.xuexi.cn/video/1006/p/131c9b7e970f2b1cb289ee1f23ad4d4c-fc11d379a8d74699bc14f31ec61d5d9f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/e8aea8cf65437dd1a6a3ee4f64150926-9171928858d64378b75e5f44171e3806-2.mp4,https://boot-video.xuexi.cn/video/1006/p/cb2393a3288c22fb33c118b47962731a-0fcc03caa2a04a0bb28314d5a5c55bfd-2.mp4,https://boot-video.xuexi.cn/video/1006/p/8d90b321cdab66934de7988d79f42d11-a5b1bf245b5048f29de29b28f0cf4b29-2.mp4,https://boot-video.xuexi.cn/video/1006/p/f0f79d4991d24406c4b1000808866aed-efbe26a5306c45df972488689c0ac6ca-2.mp4,https://boot-video.xuexi.cn/video/1006/p/e0fb2e96085f1f5db5f7492c212654c2-904f1c1ae17d4128a7af950eb010124d-2.mp4,https://boot-video.xuexi.cn/video/1006/p/19923f0e72ca7b750bf112796a14cda9-e6d6acb0e08f4b84aaf8f31dfd4ba09a-2.mp4,https://boot-video.xuexi.cn/video/1006/p/3e72c126a54dc9c8093b4301a8639a94-3f4b29907d8543c58dd2046ad853e415-2.mp4,https://boot-video.xuexi.cn/video/1006/p/22a8b76f1af75caca3bfdd47ad5ba8af-1c745b99a01c4a0a86e6ee0365aad457-2.mp4,https://boot-video.xuexi.cn/video/1006/p/4acd161d511c09fdd7c03a39a1f951b9-1813feef9a87401c9b623cd22bfc5c3f-2.mp4,https://boot-video.xuexi.cn/video/1006/p/c37f66820c0cf0e81c5474e2c57aff79-81e0cc7302d84106bcdb60292b8b3cc2-2.mp4,https://boot-video.xuexi.cn/video/1006/p/1704f9bf212e0fbaa4c6d04f65be9de1-369be5079a2240ce940400afefdb46db-2.mp4,https://boot-video.xuexi.cn/video/1006/p/969d64b4913ac02814e30f005aeb397e-07ffba0f8e4448bb873eb2206a84ee38-2.mp4,https://boot-video.xuexi.cn/video/1006/p/054d48d4c6a8ba28c196d4acf6541ae5-87e960537bf64e688a73d8588cb62bd4-2.mp4,https://boot-video.xuexi.cn/video/1006/p/0e34f3200ecf5508f2f328865826afa5-9a97e4fb7e124b9ca602c66342011701-2.mp4,https://boot-video.xuexi.cn/video/1006/p/184426272dd5b1bad60f330c7e4c6027-263cfee68ee844bbb9a41acec1098753-2.mp4"""
    namestr = """回乡偶书二首·其一,题西林壁,枫桥夜泊,游子吟,春夜喜雨,出赛二首·其一,四时田园杂兴·其三十一,赠花卿,送元二使安西,江南逢李龟年,鸟鸣涧,石灰吟,芙蓉楼送辛渐,春日,竹石,黄鹤楼送孟浩然之广陵,凉州词二首·其一,江南春,独坐敬亭山,乌衣巷,乞巧,乐游原,六月二十七日望湖楼醉书,渔歌子,寒食,七步诗,月下独酌四首·其一,秋夜将晓出篱门迎凉有感(其二),蝉,山居球暝,秋夕,宿建德江,己亥杂诗(其二百二十),闻官军收河南河北,竹里馆,夏日绝句,长歌行,竹枝词二首·其一,墨梅,示儿,游园不值,题临安邸,题都城南庄,舟过安仁,天竺寺八月十五日夜桂子,登飞来峰,咏华山,劝学,天净沙·秋,早春呈水部张十八员外(其一),春雪,溪居即事,京师得家书,乡村四月,山中送别,游山西村,晚春,过故人庄,咏白鹭,蚕妇,冬夜读书示子聿,秋思,相思,浪淘沙,游钟山,渡汉江,西江月·夜行黄沙道中,梅花,宿新市徐公店,嫦娥,约客,易水送别,江雪,舟夜书所见,暮江吟,三衢道中,望洞庭,小儿垂钓,山行,晓出净慈寺松林子方,赋得古原草送别,夜书所见,早发白帝城,九月九日忆山东兄弟,忆江南,雪梅·其一,望庐山瀑布,大林寺桃花,滁州西涧,饮湖上初晴后雨二首·其二,绝句二首·其一,所见,采莲曲,望天门山,别董大二首·其一,江畔独步寻花·其六,夜宿山寺,鹿柴,咏柳,登鹳雀楼,村居,小池,过华清宫(其一),悯农二首(其二),商山早行,明日歌,绝句,春晓,题画,书湖阴先生壁(二首其一),春望,画鸡,蜂,池上,问刘十九,菩萨蛮·书江西造口壁,山村咏怀,静夜思,牧童,清平乐·村居,赠汪伦,梅花,峨眉山月歌,夜雪,咏鹅,古朗月行(节选),十二月十五夜,悯农二首·其一,汉乐府·江南,寻隐者不遇,画"""
    urls_list = urlstr.strip().split(",")
    names_list = namestr.strip().split(",")
    print(urls_list)
    print(len(urls_list))    # 131
    print(names_list)
    print(len(names_list))   # 131
    # for i in range(len(urls_list)):
    for i in range(10):
        download_mp4_by_url(urls_list[i], names_list[i], i+1)


if __name__ == "__main__":
    main()

  • 上面和下面的程序唯一的差别就是字符的间隔方式,上面是逗号间隔,下面是回车间隔,上面会让程序行数不那么多。
# https://article.xuexi.cn/articles/video/index.html?art_id=294702920556063797
import requests
import os


def download_mp4_by_url(url, name, n):
    """
    通过链接下载视频链接下载相应的mp4视频。
    :param url: mp4视频超链接。
    :param name: 视频保存的主题名
    :param n: 视频的顺序编号
    :return:
    """
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"
    }
    video_data = requests.get(url, headers=headers).content
    if not os.path.exists("./视频"):
        os.mkdir("./视频")
    with open(f"./视频/{n}.{name}.mp4", "wb") as f:
        f.write(video_data)
        print(f"正在下载第{n}个视频:{name}")


def main():
    urlstr = """
https://boot-video.xuexi.cn/video/1006/p/5fd0919e562a1eedd1a8f740849f491a-72ee9dcf0fa440d7b8974dbea2538d39-2.mp4
https://boot-video.xuexi.cn/video/1006/p/7556c7043e88186b0bfb60a1abe27481-610517fe75974eef92edaf44fd579853-2.mp4
https://boot-video.xuexi.cn/video/1006/p/29057017b697b69ba089b141ffa7155b-72dba5794ada485fa36916ca6c4bb276-2.mp4
https://boot-video.xuexi.cn/video/1006/p/6cf3b6826f95653511f5dd8ea42b95c9-ff6425a5b1db4fc9b406c42480ebaae4-2.mp4
https://boot-video.xuexi.cn/video/1006/p/dca2b2122efa84ef43c0cf3c05b728d4-60f0576258944bea936d0aea6d9e9e50-2.mp4
https://boot-video.xuexi.cn/video/1006/p/e7c7db360b47191742ef7266aa509573-11044cf3d6d643619924122f2374bf2b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/ae79b9d0c3391a1380a866a9ce2c781a-e5b2e7be528e4d59802175f2d74af5a9-2.mp4
https://boot-video.xuexi.cn/video/1006/p/d3e06265dadc66fd354649793d8aa75e-da7788f2a0984b87b67ff1d6f3e6d6a7-2.mp4
https://boot-video.xuexi.cn/video/1006/p/5613cceb7b31f3eefb8d3c1d1279be47-b9f0d1d881474f16a057c049056daa3b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/0a3767c3924b2d0dc29b8e9c802a81da-46e9198132224d58a79abaf184b39c39-2.mp4
https://boot-video.xuexi.cn/video/1006/p/f5337dcf1029d1755d15b39e1bb34733-2a696096f6614b1780858c64ce8a29c5-2.mp4
https://boot-video.xuexi.cn/video/1006/p/fa1beb92f52913d5d0502e3fa5f096d5-1e0f65c5f8c8406eb34b6210670033c9-2.mp4
https://boot-video.xuexi.cn/video/1006/p/38566457defcadd3b6d9132a38d6ab29-0b349aaffb9c496287f4e1ef64876e86-2.mp4
https://boot-video.xuexi.cn/video/1006/p/5f8b2eb6b9dea34354d05d67f1882ada-b8ec6f074f064290a1182c6ccdae7eba-2.mp4
https://boot-video.xuexi.cn/video/1006/p/731132a6d4d87f7b9e0b9a94a65a5a06-dcf3f148b0c04724b320c7956caedf86-2.mp4
https://boot-video.xuexi.cn/video/1006/p/03a8ba3d09d1c4753546f5b3550a9251-8cec7ba4c26f4bc2bc7a6540cfb0fc7b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/77cdb7969c3fef76cb1615f3c0718a46-5b6cccd988bb40a9a4fdc271061a336f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/527970e4c8030524654803d3d159dbc8-6286fef291be46d5af41900f6988d1d4-2.mp4
https://boot-video.xuexi.cn/video/1006/p/1d6d6e6abd84ceb6368f039aa086a01c-a37df97a4cdf4212ab1982ce7dae1ab7-2.mp4
https://boot-video.xuexi.cn/video/1006/p/af756c8900e9c9b6b54412abb39be9ab-e37dd2b6537846b3a916e35d5dd99b52-2.mp4
https://boot-video.xuexi.cn/video/1006/p/271c0ec735a04cc00b9d13986d7cd65b-83c9c880f0bb4f07a103693f34aa9a95-2.mp4
https://boot-video.xuexi.cn/video/1006/p/29beed2e15abfbe3ba457a6a8d1d1c9c-660da4a738354dd09325aecfab268a43-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a421df188b71340d3d0fee3a1e19fe14-d12daf58c6b24a14b46e6c7e5dc191ea-2.mp4
https://boot-video.xuexi.cn/video/1006/p/2771da94f2ce433a17ff61f8b870bb56-7fe1239fec054348ab1a281616bc146c-2.mp4
https://boot-video.xuexi.cn/video/1006/p/0fde550a85cca3c08a8c1356e21b760b-6be5b3e2d1a34fbd84f69dc955ace72d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/418eb399a3e67bce6ef6748e848107a2-24b9382f5fa94b23ba09477508ba574f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/f82578fa00d98c2d5369661b4a833d70-ef9baf0d218f4bebb25d7ed57db15451-2.mp4
https://boot-video.xuexi.cn/video/1006/p/42466a20053129df040b6dc39af56318-376df6c52bd940229b22aeab66273800-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a153916e82b6c2b0c839dffbba49dec8-721d3890f73c404996508806848fd353-2.mp4
https://boot-video.xuexi.cn/video/1006/p/6d992bc4a29759ca59c0271ef82c95a8-8c120ce367e34ef799868ba1d0446180-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a1a44024fd503a83381f7d8d617f7a5b-79d8b33098b4415db91cfd1ccfdad1f0-2.mp4
https://boot-video.xuexi.cn/video/1006/p/bc811f4dca003b28fd650b1d49c5ba0e-6e443a4230014feb954822a7d68e0c85-2.mp4
https://boot-video.xuexi.cn/video/1006/p/af274d40ddaa2f92d813d5cb6929e4ce-0f11ba22431c49b18701bbc69c300058-2.mp4
https://boot-video.xuexi.cn/video/1006/p/41ff8cabc43fb9bc03ce7fcc0b00eab3-eddc63b4e0e54c2bbede9ed5f02f73be-2.mp4
https://boot-video.xuexi.cn/video/1006/p/8fa92f5e955de50dad8f5e6cd6d9f7ef-30147986d805487f897295f5f13cd13b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/e643da5bde09e6cd536b19ba755063cc-c54a968d54b7401484d85c2c78920e8f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/0a2edf04db75c690a612e5447ee5a070-f907ddf5c87e4456b1a9dc84d79ea3dd-2.mp4
https://boot-video.xuexi.cn/video/1006/p/5e0d7314991de52da8d5b1567813512d-3398307fc32f42cc977f8133f803b76f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/89dd21b2a52faa3c0b75ac1fca03b7cf-745f01a55bc544c4a62464b6e99903d8-2.mp4
https://boot-video.xuexi.cn/video/1006/p/bb9d200a5ed90d19a34265d0f74fe6cf-e6bd05f32ba143e8a40d71d9667e740b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/957e47de4370b3c73c065bd802c52c01-c9d90b11e50f43bf9de79fa56679784c-2.mp4
https://boot-video.xuexi.cn/video/1006/p/cfaf1576ba3b1df2fb8d1b4cfab5d26f-b2e0841da56940a7ad56340633fc6471-2.mp4
https://boot-video.xuexi.cn/video/1006/p/dba15bb80b59fbe6ab95f7360d67bc11-804eb20577ab4877bd7cda30d119ac3e-2.mp4
https://boot-video.xuexi.cn/video/1006/p/8f6d37ca8d45421b468617407df5c95f-37ee2e67fbec4a47844ec3e1ad6f6040-2.mp4
https://boot-video.xuexi.cn/video/1006/p/31176f17aeb61a6d32f960f4bd4a0686-8429f54b53f04a00b24c0bbe2817a686-2.mp4
https://boot-video.xuexi.cn/video/1006/p/5eddff452cad6fe4297e89057799e6bb-3a20a92776334dd08b7b12b5befeaf42-2.mp4
https://boot-video.xuexi.cn/video/1006/p/4aa35925803a1693b35f33736f90dd25-a29d01ca9e7440778fe1b40d78734415-2.mp4
https://boot-video.xuexi.cn/video/1006/p/d29e527934c0556141964732ff3220a1-0ec288d0ddbd44d09cd216678d791933-2.mp4
https://boot-video.xuexi.cn/video/1006/p/0b46fda6f873b0623dd981e157f7e014-acb282c7a3cd477fb72b062227815890-2.mp4
https://boot-video.xuexi.cn/video/1006/p/9f6164c2950b2d37e816fbd7c8c49347-716d290572d84d98ad301c07c17de5cb-2.mp4
https://boot-video.xuexi.cn/video/1006/p/986491bd130e85fddc048eb759cec2fd-56620b7bd08d4ee491db3aa5e7b283e2-2.mp4
https://boot-video.xuexi.cn/video/1006/p/56054bf540fa797e71e3f866c24a09ce-8e9cbf1476ef4dca9b6a7d3bdbfaaf90-2.mp4
https://boot-video.xuexi.cn/video/1006/p/2c7adba23f684e661a7a72766c8a9c17-d734f23b6cbb4ac58dc65ed0cfb42568-2.mp4
https://boot-video.xuexi.cn/video/1006/p/631cb0e564b1944c9ecd957c34a57e88-7c10d4b506d84a8eb03e65b18375ef38-2.mp4
https://boot-video.xuexi.cn/video/1006/p/43ea00ebb945581bf72cde9ca89f2da6-08b1848464374392841074537a34b02d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/46bfe422e70f5d28e248f9ab0d121c38-3e07163b3488418d9ac47fc1798b6bf6-2.mp4
https://boot-video.xuexi.cn/video/1006/p/83f771f0bd7369059b77c3b56ccf7664-9fc2cb92c367485887ea27da8aca904e-2.mp4
https://boot-video.xuexi.cn/video/1006/p/2ee715f21f61106f83e4f901426f136c-1e928dd5f7894ec98cf01123cecd0cab-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a21341b0f5365a32fb8ae2313ae4fc7f-70ec698a68504d74ac87ef4d85f2dec9-2.mp4
https://boot-video.xuexi.cn/video/1006/p/6d3df788e997368bf7163d0dea38acae-0a23ca135101497f931409eed598b5b1-2.mp4
https://boot-video.xuexi.cn/video/1006/p/83ff2a8a6450a5983469c043dfd2ab9b-a03cf7420bf14e809c3501c9cba48cc6-2.mp4
https://boot-video.xuexi.cn/video/1006/p/52c48538b7008cdd480567dea643fa1d-5067f428d79d4758adf6931011a243ec-2.mp4
https://boot-video.xuexi.cn/video/1006/p/6f79a0cd7731e53de00aef3f77b6ba75-1b9f9f0f3318445c8714db7177c75eed-2.mp4
https://boot-video.xuexi.cn/video/1006/p/502ca838457f46985e7d339c9dd94d84-7b79ac473f62441fbc6191ad1c0ed4ef-2.mp4
https://boot-video.xuexi.cn/video/1006/p/f2dfec5d09fd5c3d7b06d65be1afbf44-5124232c0efd41a2b28dd1a5fd991ff9-2.mp4
https://boot-video.xuexi.cn/video/1006/p/29a6bdcbda1d9360fa4c97add1b21258-a6b68866bc8748398a2ac6ff8f1340ad-2.mp4
https://boot-video.xuexi.cn/video/1006/p/1f57dd2a0cf5b7e97e63c6e884087a90-a0a325f1bb2849f5a467bb997bf21878-2.mp4
https://boot-video.xuexi.cn/video/1006/p/70f2c3fb09c7c798c18ea2e64e64252b-40629663598848f6a5ea55ae7fc95732-2.mp4
https://boot-video.xuexi.cn/video/1006/p/ce6daa2b530771a5f69b207e011e82cb-57309ee44bf944e48a79b9b09c84c758-2.mp4
https://boot-video.xuexi.cn/video/1006/p/4961b8cd99003f6f41382e4ebb89fcef-51bd8225f3b149239c18f6b300b48f0f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/73f29350eb985704089b7b61a6eaf3e4-c7f4b173d8dd4195b61242f14ef15c46-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a219b07be0bc35ff41ad5ebf068dc34f-e6736b582b2b4591aa4f100f8b94b7ab-2.mp4
https://boot-video.xuexi.cn/video/1006/p/410a9f2f0b6192bdbdaa39396221f52c-6852abed973d42349d4c9bedbc550f6b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/2ab710a6ce7ddaf96aa1b28e0cf4f6c3-abcb2769e33347559f5e8d2b286b3dd3-2.mp4
https://boot-video.xuexi.cn/video/1006/p/15f6c34100bf876c7dcc0049592d683e-734f90bde3904afa98580647fdbe398b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/71ce68defb78b286f976b4530a830a6f-98b9f922db814055b52f4a8f9281bafc-2.mp4
https://boot-video.xuexi.cn/video/1006/p/3a2c3bb124c84f6a917db9e048692f70-bbae575fb9ff4eafb32cc78fecd1177d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/af73e42dffa0206148713cd5555eceb7-1c22d2375710400d8e7c3f4071e5e644-2.mp4
https://boot-video.xuexi.cn/video/1006/p/88e36e96e5a09720aae36b67ed7c18f6-767d5dc02b2f46c18c202726bdd3fcee-2.mp4
https://boot-video.xuexi.cn/video/1006/p/8529ebb9aa153b4d04325e8584b1cd44-8cc16ecb8ad2441ebedf9d3cef76ebb5-2.mp4
https://boot-video.xuexi.cn/video/1006/p/4cbcf0776115a5a2409743c6286a7518-19c79ec4844646e78a12066c9d60e56b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/cff211b0944565f0957ce65053239889-f485890a475047eebf81676a914acf96-2.mp4
https://boot-video.xuexi.cn/video/1006/p/649a17f375e581227c785f07f008164b-ff245af5c0b34118b118783865876148-2.mp4
https://boot-video.xuexi.cn/video/1006/p/395bfdbbfa2a13c48b42dffe60a964bb-db31575eb79548f087c8529fe8c57516-2.mp4
https://boot-video.xuexi.cn/video/1006/p/8c52ce19002c1b856d0efdacc1038db8-bc33fa71867440b8a62c34b1f59b4cba-2.mp4
https://boot-video.xuexi.cn/video/1006/p/3d0bfb2473842a295440720e7542bbba-43027d30f1bb49849fadf3f3679f913c-2.mp4
https://boot-video.xuexi.cn/video/1006/p/519b8af4b34e66ae125d551241434a83-eefe47cb08f24a63bf909094014676dd-2.mp4
https://boot-video.xuexi.cn/video/1006/p/fec74636fee82ccf3f47c5a1b96ba3ca-2e0d6d812d994b8693f77c813034ca27-2.mp4
https://boot-video.xuexi.cn/video/1006/p/3ce509ee964328884c429c416316e6eb-6d2ee7402de84677869bd6f44e408e1a-2.mp4
https://boot-video.xuexi.cn/video/1006/p/bd622a6f00cae493ca1205a035c93bf3-7224ed9b66d14cd1bd472637fc454853-2.mp4
https://boot-video.xuexi.cn/video/1006/p/02797843a2932a33e05ab8fa2b554d42-389940076e71460398a864ea6c32570c-2.mp4
https://boot-video.xuexi.cn/video/1006/p/da464b41516e6f53e1958d2f5702f53d-f614569db0f14e0ca1599222c17fb327-2.mp4
https://boot-video.xuexi.cn/video/1006/p/3ec09182194483e86ec42aa9cf5599f2-bdba19cc1ad84deb847bc6f1b70534eb-2.mp4
https://boot-video.xuexi.cn/video/1006/p/7b26c133b0cfca42ecf2ccbbfc36e689-42b9ff237c884d4dbce2a2842c8faf53-2.mp4
https://boot-video.xuexi.cn/video/1006/p/ad2d5062484e74e05641810d06e71c25-879dfddb8e0049c19680ae7bdff7a403-2.mp4
https://boot-video.xuexi.cn/video/1006/p/1cc397e194d914206a193a0dcbaaf649-f91e7a62bbdf4c4eafd27555096644e2-2.mp4
https://boot-video.xuexi.cn/video/1006/p/b0360d98873df7e7854e30e20dabd107-6e2cdd39c434474cbe408bcc4eeb0594-2.mp4
https://boot-video.xuexi.cn/video/1006/p/d5b209f3d6f05c4adbecab5dd415d58a-45c825d86b0640b5a20b445dd9ee1dc2-2.mp4
https://boot-video.xuexi.cn/video/1006/p/98bef60af42e3d6471bf1df948271118-58f6145b62d044fa9b5fa6ab86b64903-2.mp4
https://boot-video.xuexi.cn/video/1006/p/eb44453847aa49b61a174aec80abfc24-c0eb3b0efe794496b46a7fc22c5b969d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/229f90b1ebf77732b3e6b426b82b07c0-92a75187186342d98630cc271b4efe5f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/2be1df82bd23510e11257533486ecd23-77cdbfbe7f104d04acb276c4f6587b78-2.mp4
https://boot-video.xuexi.cn/video/1006/p/c46ee3226a22101331473c2397149c6f-69e2474d16e94f399d21a1d443b7c4c8-2.mp4
https://boot-video.xuexi.cn/video/1006/p/135ff5aba7cd42529db9f43e06149cd0-f6260aafb4514ba3915288e7b8bb2c3d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/e9e0d0dce252ead465243991dead1585-d946b3e7c002413fbcd3f949813a7be4-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a5b6ed955d7769af321c29b33059e545-2ffef5615a69435dbc93b7385072514c-2.mp4
https://boot-video.xuexi.cn/video/1006/p/f71231f0ff95a31d883e7a459d7ac7a5-59d3a7417c3a4671b7e75da2646097a7-2.mp4
https://boot-video.xuexi.cn/video/1006/p/14b972a46469283fe35ab9dc1746ca2e-be534fd49c23443898886d25084a5b24-2.mp4
https://boot-video.xuexi.cn/video/1006/p/aa1c1d3b2055f8e4e8e4bd135e162c0f-76aa004b273f4755a0d7a81fed81cf14-2.mp4
https://boot-video.xuexi.cn/video/1006/p/96ad67bd488fbee5edc05d882e687e46-78719eefb76c4b3d98db80c312e6060f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/23c5b6b4a2a68c2555f4bc742236ca9b-a8298be10a9c4fbaa81c2cea3072932d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/a1675428e11e764fbd1768b7f574b232-b7a9f438df8344f5861864c75e0bc9dd-2.mp4
https://boot-video.xuexi.cn/video/1006/p/e978f876a8417a42b21fdc980aff8925-778554c730d44be98bfe99352328479b-2.mp4
https://boot-video.xuexi.cn/video/1006/p/aac5acc7939a9590043d86be9f069e2d-ee3d8dbccb074707a1abf50ee4ea1cae-2.mp4
https://boot-video.xuexi.cn/video/1006/p/6a8657cc800fcbdebdc8f65864c4ebe4-e581f011019948dc98f37039085fc1b6-2.mp4
https://boot-video.xuexi.cn/video/1006/p/131c9b7e970f2b1cb289ee1f23ad4d4c-fc11d379a8d74699bc14f31ec61d5d9f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/e8aea8cf65437dd1a6a3ee4f64150926-9171928858d64378b75e5f44171e3806-2.mp4
https://boot-video.xuexi.cn/video/1006/p/cb2393a3288c22fb33c118b47962731a-0fcc03caa2a04a0bb28314d5a5c55bfd-2.mp4
https://boot-video.xuexi.cn/video/1006/p/8d90b321cdab66934de7988d79f42d11-a5b1bf245b5048f29de29b28f0cf4b29-2.mp4
https://boot-video.xuexi.cn/video/1006/p/f0f79d4991d24406c4b1000808866aed-efbe26a5306c45df972488689c0ac6ca-2.mp4
https://boot-video.xuexi.cn/video/1006/p/e0fb2e96085f1f5db5f7492c212654c2-904f1c1ae17d4128a7af950eb010124d-2.mp4
https://boot-video.xuexi.cn/video/1006/p/19923f0e72ca7b750bf112796a14cda9-e6d6acb0e08f4b84aaf8f31dfd4ba09a-2.mp4
https://boot-video.xuexi.cn/video/1006/p/3e72c126a54dc9c8093b4301a8639a94-3f4b29907d8543c58dd2046ad853e415-2.mp4
https://boot-video.xuexi.cn/video/1006/p/22a8b76f1af75caca3bfdd47ad5ba8af-1c745b99a01c4a0a86e6ee0365aad457-2.mp4
https://boot-video.xuexi.cn/video/1006/p/4acd161d511c09fdd7c03a39a1f951b9-1813feef9a87401c9b623cd22bfc5c3f-2.mp4
https://boot-video.xuexi.cn/video/1006/p/c37f66820c0cf0e81c5474e2c57aff79-81e0cc7302d84106bcdb60292b8b3cc2-2.mp4
https://boot-video.xuexi.cn/video/1006/p/1704f9bf212e0fbaa4c6d04f65be9de1-369be5079a2240ce940400afefdb46db-2.mp4
https://boot-video.xuexi.cn/video/1006/p/969d64b4913ac02814e30f005aeb397e-07ffba0f8e4448bb873eb2206a84ee38-2.mp4
https://boot-video.xuexi.cn/video/1006/p/054d48d4c6a8ba28c196d4acf6541ae5-87e960537bf64e688a73d8588cb62bd4-2.mp4
https://boot-video.xuexi.cn/video/1006/p/0e34f3200ecf5508f2f328865826afa5-9a97e4fb7e124b9ca602c66342011701-2.mp4
https://boot-video.xuexi.cn/video/1006/p/184426272dd5b1bad60f330c7e4c6027-263cfee68ee844bbb9a41acec1098753-2.mp4
"""
    namestr ="""回乡偶书二首·其一
题西林壁
枫桥夜泊
游子吟
春夜喜雨
出赛二首·其一
四时田园杂兴·其三十一
赠花卿
送元二使安西
江南逢李龟年
鸟鸣涧
石灰吟
芙蓉楼送辛渐
春日
竹石
黄鹤楼送孟浩然之广陵
凉州词二首·其一
江南春
独坐敬亭山
乌衣巷
乞巧
乐游原
六月二十七日望湖楼醉书
渔歌子
寒食
七步诗
月下独酌四首·其一
秋夜将晓出篱门迎凉有感(其二)
蝉
山居球暝
秋夕
宿建德江
己亥杂诗(其二百二十)
闻官军收河南河北
竹里馆
夏日绝句
长歌行
竹枝词二首·其一
墨梅
示儿
游园不值
题临安邸
题都城南庄
舟过安仁
天竺寺八月十五日夜桂子
登飞来峰
咏华山
劝学
天净沙·秋
早春呈水部张十八员外(其一)
春雪
溪居即事
京师得家书
乡村四月
山中送别
游山西村
晚春
过故人庄
咏白鹭
蚕妇
冬夜读书示子聿
秋思
相思
浪淘沙
游钟山
渡汉江
西江月·夜行黄沙道中
梅花
宿新市徐公店
嫦娥
约客
易水送别
江雪
舟夜书所见
暮江吟
三衢道中
望洞庭
小儿垂钓
山行
晓出净慈寺松林子方
赋得古原草送别
夜书所见
早发白帝城
九月九日忆山东兄弟
忆江南
雪梅·其一
望庐山瀑布
大林寺桃花
滁州西涧
饮湖上初晴后雨二首·其二
绝句二首·其一
所见
采莲曲
望天门山
别董大二首·其一
江畔独步寻花·其六
夜宿山寺
鹿柴
咏柳
登鹳雀楼
村居
小池
过华清宫(其一)
悯农二首(其二)
商山早行
明日歌
绝句
春晓
题画
书湖阴先生壁(二首其一)
春望
画鸡
蜂
池上
问刘十九
菩萨蛮·书江西造口壁
山村咏怀
静夜思
牧童
清平乐·村居
赠汪伦
梅花
峨眉山月歌
夜雪
咏鹅
古朗月行(节选)
十二月十五夜
悯农二首·其一
汉乐府·江南
寻隐者不遇
画
"""
    urls_list = urlstr.strip().split("\n")
    names_list = namestr.strip().split("\n")
    print(urls_list)
    print(len(urls_list))    # 131
    print(names_list)
    print(len(names_list))   # 131
    # for i in range(len(urls_list)):
    for i in range(10):
        download_mp4_by_url(urls_list[i], names_list[i], i+1)


if __name__ == "__main__":
    main()

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

重装系统之后,电脑连网卡都没反应怎么办?

前言 有些电脑比较奇葩,安装完成之后会出现网卡连驱动都没有,这时候要安装电脑驱动可是真的烦躁。怎么下手呢? 如果确定电脑的网卡型号还好,直接找个电脑下载个对应的网卡驱动,用U盘复制过去就能安装。 但如果不知道…

openharmony launcher 调研笔记(02)UI 调用逻辑

最近在看launcher,把自己调研的点做个笔记,持续修改更新中,个人笔记酌情参考。 EntryView Column() { PageDesktopLayout(); } .height(this.workSpaceHeight) // this.mWorkSpaceHeight this.mScreenHe…

【深度学习】海洋生物数据集,图片分类

文章目录 任务描述数据收集数据处理模型训练指标评测web app代码和帮助 任务描述 收集9种以上的海洋生物图片,然后基于深度学习做一个分类模型,训练完成后,分类模型就可以对未知图片进行分类。 在之后随便传一张图片,分类模型就…

016——DHT11驱动开发(基于I.MX6uLL)

目录 一、 模块介绍 1.1 简介 1.2 电路描述 1.3 通信协议 二、 驱动程序 三、 应用程序 四、 上机实验 一、 模块介绍 1.1 简介 DHT11 是一款可测量温度和湿度的传感器。比如市面上一些空气加湿器,会测量空气中湿度,再根据测量结果决定是否继续加…

【vite】-【vite介绍】-【vite的基础应用】-【vite的高级应用】-【

目录 vite介绍vite的基础应用vite创建项目vite创建vue3项目vite创建vue2项目vite创建react项目 vite中使用css的各种功能vite中使用tsvite中处理静态资源的方法vite集成eslint和prettiervite中的env环境变量 vite的高级应用 vite介绍 一、特点: 开发时效率极高开箱…

springcloud第4季 springcloud-gateway网关的功能作用

一 网关 1.1 gateway的作用 网关可以实现: 权限过滤拦截,请求转发;组包拆包,加密解密,报文解析,协议转换等功能。 cloud gateway本身也是一个微服务,需要注册进服务到注册中心,从…

LeetCode 378 有序矩阵中第K小的元素

题目信息 LeetoCode地址: . - 力扣(LeetCode) 题解内容大量转载于:. - 力扣(LeetCode) 题目理解 题意很直观,就是求二维矩阵中所有元素排序后第k小的数。 最小堆写法 该写法不再赘述,维护…

simulink的硬件支持下,串口发送的模型,stm32f407的串口程序调试错误

串口调试助手能接收到数据,为何是8个数据?如之奈何? 参考文章: STM32CubeMxMATLAB Simulink串口输出实验_用stm32cubemx生成的串口都是输出-CSDN博客根据 该文章发送字符串 hello,发送数量为5,接收也是he…

解读命令:icacls “E:\ShareAll“ /grant “Everyone:(OI)(CI)(F)“

命令 icacls "E:\ShareAll" /grant "Everyone:(OI)(CI)(F)" 是在Windows操作系统中用来修改文件或目录权限的命令行操作。该命令执行以下操作: 路径:"E:\ShareAll" 指定了要更改权限的目录位置,即对E盘下的“S…

Cisco Packet Tracer配置AAA认证

出口路由器R1配置: ip domain-name cisco.com;写入设备的默认域名 crypto key generate rsa;产生rsa密钥 ip ssh secret cisco;启用ssh服务 enable secret cisco;设置特权模式密码 连接TACAS的路由器做同样配置 RADIUS服务器的配置 client ip 配置成RADIUS服务器…

二分法题集2

目录 1 山脉数组的峰顶索引 分析: 代码展示: 2 寻找峰值 分析: 代码展示: 3 寻找旋转排序数组中的最小值 分析: 代码展示: 4 点名 分析: 代码展示: 1 山脉数组的峰顶…

数据结构学习——栈和队列

1.栈 1.1栈的概念及结构 栈:一种特殊的线性表,其只允许在固定的一端进行插入和删除元素操作。进行数据插入和删除操作的一端 称为栈顶,另一端称为栈底。栈中的数据元素遵守后进先出LIFO(Last In First Out)的原则。 …

《BERT》论文笔记

原文链接: [1810.04805] BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (arxiv.org) 原文笔记: What: BETR:Pre-training of Deep Bidirectional Transformers for Language Understand…

Ruoyi-vue-pro Vue + nginx 二级目录部署到云服务器

http://www.your-server.com/ 这是一级目录,由于项目多,一般会通过二级域名http://oa.your-server.com/或二级目录http://www.your-server.com/oa来发布,本篇记录一下二级目录发布。先看效果 1、router/index.js配置base export default new …

对代理模式的理解

目录 一、前言二、案例1 代码2 自定义代理类【静态代理】2.1 一个接口多个实现,到底注入哪个依赖呢?2.1.1 Primary注解2.1.2 Resource注解(指定name属性)2.1.3 Qualifier注解 2.2 面向接口编程2.3 如果没接口咋办呢?2.…

算法基础课-搜索与图论

DFS 题目链接&#xff1a;842. 排列数字 - AcWing题库 思路&#xff1a;写的很好的题解AcWing 842. 排列数字--深度优先遍历代码注释 - AcWing #include<bits/stdc.h>using namespace std; int n; int st[10]; vector<int> a; void dfs(){if(a.size() n){for(in…

python标准数据类型--集合常用方法

在Python中&#xff0c;集合&#xff08;Set&#xff09;是一种无序且不重复的数据结构&#xff0c;它是由一个无序的、不重复的元素组成的。Python中的集合与数学中的集合概念相似&#xff0c;并且支持一系列常用的方法。本篇博客将深入介绍Python集合的常用方法&#xff0c;帮…

c# wpf XmlDataProvider 简单试验

1.概要 2.代码 <Window x:Class"WpfApp2.Window12"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x"http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d"http://schemas.microsoft.com/expression/blend…

【C++初阶】String在OJ中的使用(一):仅仅反转字母、字符串中的第一个唯一字母、字符串最后一个单词的长度、验证回文串、字符串相加

前言&#xff1a; &#x1f3af;个人博客&#xff1a;Dream_Chaser &#x1f388;博客专栏&#xff1a;C &#x1f4da;本篇内容&#xff1a;仅仅反转字母、字符串中的第一个唯一字母、字符串最后一个单词的长度、验证回文串、字符串相加 目录 917.仅仅反转字母 题目描述&am…

C#操作MySQL从入门到精通(5)——查询数据

前言 在和MySql数据库交互的过程中,查询数据是使用最频繁的操作,本文详细介绍了查询数据的各种操作,包括查询一列数据、 查询两列数据、查询所有列数据、查询不重复的数据、查询指定行数据,绝对是C#操作MySql数据库史上最详细教程,能够帮助小白快速入门以及将这些功能迅速…