{"id":97,"date":"2024-03-28T13:57:52","date_gmt":"2024-03-28T05:57:52","guid":{"rendered":"https:\/\/aixiu.shop\/?p=97"},"modified":"2024-03-28T13:58:57","modified_gmt":"2024-03-28T05:58:57","slug":"97","status":"publish","type":"post","link":"https:\/\/aixiu.shop\/?p=97","title":{"rendered":"\u5173\u4e8eopen sora plan\u6570\u636e\u96c6\u2013\u4e0b\u8f7d\u7bc7"},"content":{"rendered":"<h1>\u5173\u4e8eopen sora plan\u6570\u636e\u96c6--\u4e0b\u8f7d\u7bc7<\/h1>\n<h2>\u4e0b\u8f7d\u6e20\u9053<\/h2>\n<ol>\n<li>cc0 \u534f\u8bae\u7f51\u7ad9 pexels<\/li>\n<li>\u5f00\u6e90\u6570\u636e\u96c6 panda70m<\/li>\n<li>youtube8m<\/li>\n<li>\u5f85\u6dfb\u52a0<\/li>\n<\/ol>\n<h2>\u4e0b\u8f7d\u51c6\u5907\u5de5\u4f5c<\/h2>\n<ol>\n<li>\u4e0b\u8f7d\u8fdc\u7a0b\u4e3b\u673a<\/li>\n<li>ssh \u672c\u5730\u5b58\u50a8\u673a\u5668<\/li>\n<\/ol>\n<h2>\u4e0b\u8f7d\u4e13\u7528\u4ee3\u7801<\/h2>\n<ul>\n<li>\n<p>\u6240\u6709\u4ee3\u7801\u53ea\u7ed9\u51fa\u4e0b\u8f7d\u7247\u6bb5\uff0c\u9700\u8981\u6d77\u91cf\u4e0b\u8f7d\u8bf7\u81ea\u884c\u4fee\u6539\u903b\u8f91\uff0c\u6216\u8005\u8054\u7cfb\u672c\u4eba\u3002<\/p>\n<\/li>\n<li>\n<p>pexels<\/p>\n<\/li>\n<\/ul>\n<pre><code>import requests\nimport os\n\ndef save_video(slug, author_id, video_id, fps, width):\n    #\u4e0b\u8f7d\u4e00\u4e2a\u89c6\u9891\u6240\u9700\u8981\u7684\u53c2\u6570\n    #https:\/\/download.pexels.com\/vimeo\/364640745\/pexels-magda-ehlers-3040808.mp4?fps=29.97&amp;width=3840\n    save_folder = &#039;.\/&#039;\n    #\u4fee\u6539\u4e3a\u81ea\u5df1\u7684headers\n    headers = {}\n    # \u907f\u514d\u88abban IP \u4fee\u6539\u4e3aIP\u4ee3\u7406\n    proxies = {}\n    video_url = f&#039;https:\/\/download.pexels.com\/vimeo\/{video_id}\/{slug}-{author_id}.mp4?fps={fps}&amp;width={width}&#039;\n    resp = requests.get(video_url, headers=headers, proxies=proxies, timeout=10)\n    file_name = os.path.join(save_folder, str(author_id)+&#039;.mp4&#039;)\n    with open(file_name, &#039;wb&#039;) as w:\n        w.write(resp.content)\n<\/code><\/pre>\n<ul>\n<li>panda70m youtube8m \u90fd\u662f\u4e00\u6837\u7684\u4e0b\u8f7d\u65b9\u6cd5<\/li>\n<li>\u63d0\u524d\u5b89\u88c5yt-dlp\u5e93<\/li>\n<\/ul>\n<pre><code>import os\nimport os.path as osp\nimport json\nimport yt_dlp\n\ndef ytb_download(uid, url, json_info, output_dir=&quot;ytb_videos\/&quot;):\n    os.makedirs(output_dir, exist_ok=True)\n    yt_opts = {\n        &quot;format&quot;: &quot;best&quot;,  # Download the best quality available\n        &quot;outtmpl&quot;: osp.join(output_dir, f&quot;{uid}.%(ext)s&quot;),\n        &quot;proxy&quot;: &quot;&quot;,\n        &quot;postprocessors&quot;: [\n            {\n                &quot;key&quot;: &quot;FFmpegVideoConvertor&quot;,\n                &quot;preferedformat&quot;: &quot;mp4&quot;,  # Convert video to mp4 format\n            }\n        ],\n\n    video_path = osp.join(output_dir, f&quot;{uid}.mp4&quot;)\n    meta_path = osp.join(output_dir, f&quot;{uid}.json&quot;)\n    if osp.exists(video_path) and osp.exists(meta_path):\n        print(f&quot;{uid} already labeled.&quot;)\n        return 0\n\n    try:\n        with yt_dlp.YoutubeDL(yt_opts) as ydl:\n            ydl.download([url])\n        with open(osp.join(output_dir, f&quot;{uid}.json&quot;), &quot;w&quot;) as fp:\n            json.dump(json_info, fp, indent=2)\n        return 0\n    except:\n        return -1\n<\/code><\/pre>\n<ul>\n<li>\u4ee5\u4e0a\u4ee3\u7801\u8bf7\u6839\u636e\u9700\u6c42\u53ef\u6539\u591a\u7ebf\u7a0b\uff0c\u6216\u8005\u534f\u7a0b<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8eopen sora plan\u6570\u636e\u96c6&#8211;\u4e0b\u8f7d\u7bc7 \u4e0b\u8f7d\u6e20\u9053 cc0 \u534f\u8bae\u7f51\u7ad9 pexels \u5f00\u6e90\u6570\u636e\u96c6 pan [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,5],"tags":[],"topic":[],"_links":{"self":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":2,"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":99,"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions\/99"}],"wp:attachment":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}