1. 首页
  2. 文章列表
  3. 利用gitlab或gitee作为网站免费图床的实现

在几个月以前,大家都还在开开心心的撸着新浪图床的羊毛,突然在某一天开始,新浪图床的图片接二连三的全挂掉了,所有的新浪图床图片全部都加上防盗链了,请求报403,当然也包括博主我在内的,当时的内心是崩溃的,于是赶紧想办法,在无奈之下,想了一个馊主意,那就是先把网站的Refer暂时先屏蔽掉,于是,就在网站的母版页面加上了下面这段代码:

<meta name="referrer" content="no-referrer">

加上之后,网站的所有图片确实可以继续正常访问了,但也只是临时解决方案,所以趁正常的时候赶紧想办法搬到其他还有什么可以撸的免费图床,想到了sm.ms人民网图床,那就写代码来搬图床吧,但馊主意毕竟是馊主意,在搬图床的时候,发现了sm.ms有上传频次限制,同时还有图片被和谐掉的可能,而人民网图床有上传失败和上传后图片格式不正确的问题

免费图床就没有可以继续撸得了么???

无奈之下想到了阿里云OSS,说干就干,马上开通了阿里云OSS,把图片都搬过去了,感觉美滋滋,然而,在用了两天的OSS之后又发现,这玩意儿太耗流量了吧,一天跑掉10多GB的流量,有点吃不消(因为网站没备案,所以用不了阿里云的CDN加速)!

还是只有想办法看看有什么既可靠又免费的图床,于是想到了gayhub,但怎么通过代码的形式传图到gayhub呢?便开始了看API文档以及Google查找有没有相关的实现案例,很遗憾,没有找到相关的实现。

这时候一同事竟然给了我一个馊主意:手动传图到gayhub!我每次发表和修改文章需要传图的时候你告诉我需要手动传到gayhub上去???

懒得勤快的博客_互联网分享精神

我又想到了gaylab,于是又研究gaylab的API,发现,好像有点靠谱的样子,那就研究研究吧,但gayhub和gaylab的域名ping值实在是太高了,就算直接传上去了,访问速度也是相当慢的,不过gaylab毕竟是开源的,任何人都可以私人部属一个git托管服务器(因为之前传TeamViewer之类的资源撸过很多速度快的gaylab),如果把gaylab的API搞通之后,我再去撸个国内某大学的gaylab账号,不就可以实现免费图床了嘛!如果我多去撸几个gaylab账号,不就可以实现图床CDN分流了么,一个挂掉了我再批量替换一下地址就行了,图片始终还在!

那就开干吧!经过研究发现,gaylab都不能直接上传文件的,而是必须把文件转成Base64编码后,通过json提交到服务端进行创建文件。而且需要配置相关授权信息。

开始放码过来了!

上传图片到gaylab

要能够顺利上传图片到gaylab,大致流程是

创建一个公共仓库;
生成private_token;
根据生成的private_token去获取你要上传的仓库的repository_id;
有了repository_id便可以调对应的API去上传文件到gaylab了;
上传成功后便可直接访问文件

首先我们创建一个公共仓库imgbed

懒得勤快的博客_互联网分享精神

接下来需要创建一个private_token,在gaylab的个人设置页面,选择左边的【Access Token】菜单,右边填写token的名字和勾上相关权限,就可以创建private_token了

懒得勤快的博客_互联网分享精神

懒得勤快的博客_互联网分享精神

有了这个token,我们便可以查找到repository_id,通过接口/api/v4/projects?private_token=<你的private_token>&search=<项目仓库名>就可以查找到仓库的id,比如我查询到我的仓库id是29

懒得勤快的博客_互联网分享精神

现在就可以拿着我们的private_token和repository_id去上传文件了,接口地址:/api/v4/projects/<项目id>/repository/files/<文件路径>,请求方式post

添加请求头:PRIVATE-TOKEN,值为private_token

Request body格式如下:

{
    "branch": "master", // 需要上传到哪个分支,必填
    "author_email": "[email protected]", // 上传人邮箱,必填
    "author_name": "Firstname Lastname", // 上传人名字,必填
    "encoding":"base64", // 文件内容编码,一定是Base64
    "content": "some content", // Base64编码的文件内容,必填
    "commit_message": "create a new file" // 提交信息,必填
}

官网文档说明:https://docs.gitlab.com/ee/api/repository_files.html#create-new-file-in-repository

比如我想上传一个文件名为test.jpg的图片,则接口地址为/api/v4/projects/29/repository/files/test.jpg

请求头为:

PRIVATE-TOKEN:xxxx

请求体为:

{
    "branch": "master",
    "author_email": "[email protected]",
    "author_name": "懒得勤快",
    "encoding":"base64",
    "content": "iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAgAElEQVR4XtW9eZBs13kf9rtr73tPz/7mLVhJUFxASoxNWRvl7Q+XJVVcTpyUZKdkS3bFkelYKpeiouxUKnFcikMrLlfKSaS4IiVRmVEcyVoo05JIAiQAgsAD8IAH4O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YAtlK0cLy0l4IbPTaAaZR5bhtXDnEIr/ah4VldOIwR3uR6L70J4MVjqFo4c7POeKLFJa2ClNkBtMoeXSGGk0ssFFtlRAsVLngANtaUOBeur/7XXb6OwciRbStOj2pwAJ7XBGkwDoZUkCEJFkSyUW+yRVzFwOk14Xh2+9A2805q1oc2sNaBmbN7vUhlMcb+/wfc18hmd2bX/rbR6xZFcLTLAkgWh8Q2V1FbZO3Ystnv+RojHFqTRSdhapRhlaUWymlWxIuozBdJ7eXXR+8vP/F76+g5qRAjUtAAAAAElFTkSuQmCC",
    "commit_message": "上传一张图片"
}

如果上传成功,接口将返回201的状态码。

懒得勤快的博客_互联网分享精神

既然现在已经调通了,我们也可以落实到具体的代码实现了,大致就有两种方向了,一种是直接上传一个本地文件,另一种则是直接上传一个流,这里我们一上传二进制流为例来实现,既然上传流都能实现,那上传一个本地文件还不简单么?

因为需要一个Base64,所以我们需要把一个二进制流转换成Base64后再上传。

        /// <summary>
        /// gitlab图床
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        public async Task<(string url, bool success)> UploadGitlab(Stream stream, string file)
        {
            string base64String = Convert.ToBase64String(stream.ToByteArray()); // 将流转换成Base64编码
            _httpClient.DefaultRequestHeaders.Add("PRIVATE-TOKEN", "你的PRIVATE-TOKEN"); // 添加请求头
            string path = $"{DateTime.Now:yyyyMMdd}/{Path.GetFileName(file)}";
            using (var resp = await _httpClient.PostAsJsonAsync("https://gitlab.com/api/v4/projects/29/repository/files/" + HttpUtility.UrlEncode(path), new
            {
                branch = "master",
                author_email = "[email protected]",
                author_name = "ldqk",
                encoding = "base64",
                content = base64String,
                commit_message = "上传一张图片"
            }))
            {
                if (resp.IsSuccessStatusCode || (await resp.Content.ReadAsStringAsync()).Contains("already exists"))
                {
                    return ("https://gitlab.com/ldqk/imgbed/raw/master/" + path, true);
                }
            }

            return await UploadSmms(stream, file);
        }

到此,通过代码实现了gaylab的图床,但是我还是不满足,撸的最快的某大学的gaylab感觉还是有点慢,于是我又想到了gitee(我为什么没早想到它???)

上传图片到码云

相比于之前撸的其他的免费gaylab,可靠性应该也比不过码云,而且码云还更快啊!文档也更友好啊!相比于gaylab,这个就更简单了。

和刚才的流程也差不多,同样需要先建一个公共仓库,然后生成一个access_token,我们到gitee的个人设置页面找到【私人令牌】就可以创建一个access_token。

懒得勤快的博客_互联网分享精神

勾上一些权限后,即可创建access_token;

懒得勤快的博客_互联网分享精神

懒得勤快的博客_互联网分享精神

创建好之后,我们甚至可以直接在gitee的swagger API文档页面在线调试:https://gitee.com/api/v5/swagger#/postV5ReposOwnerRepoContentsPath

有了这么友好的文档,代码实现也就不难了吧。

        /// <summary>
        /// 码云图床
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        public async Task<(string url, bool success)> UploadGitee(Stream stream, string file)
        {
            string base64String = Convert.ToBase64String(stream.ToByteArray());
            string path = $"{DateTime.Now:yyyyMMdd}/{Path.GetFileName(file)}";
            using (var resp = await _httpClient.PostAsJsonAsync("https://gitee.com/api/v5/repos/<用户名>/<仓库名>/contents/" + HttpUtility.UrlEncode(path), new
            {
                access_token = "你的access_token",
                content = base64String,
                message = "上传一张图片"
            }))
            {
                if (resp.IsSuccessStatusCode || (await resp.Content.ReadAsStringAsync()).Contains("already exists"))
                {
                    return ("https://gitee.com/<用户名>/<仓库名>/raw/master/" + path, true);
                }
            }

            return await UploadSmms(stream, file);
        }

是不是觉得gitee非常适合拿来做图床了呢?真香!

懒得勤快的博客_互联网分享精神 

总结

为了防止上传失败,我们可以依次做熔断降级,来达到图床稳定,比如:

如果gitee上传失败,则尝试上传到gaylab,如果gaylab失败,则传到OSS,然后继续降级到sm.ms以及人民网图床等!

现在又有这么多的图床可以撸了!


最后,附上博主博客的图床客户端完整实现代码:https://github.com/ldqk/Masuit.MyBlogs/blob/master/src/Masuit.MyBlogs.Core/Common/ImagebedClient.cs

分享到:

公益机场速鹰666,每日签到免费领流量 [推广]

公益机场速鹰666,每日签到免费领流量

真正大鸡场,100多个节点,V2ray节点50多个。港台美日新均有白嫖节点,每日签到送1-7G流量。多条BGP中转/Azure/Dmit/HKT/Hinet/多点IPLC/保证高端用户使用需求。

版权声明:

🈲⚠本文为作者原创,仅用于本站访客学习、研究和交流目的,未经授权禁止转载。️⚠🈲

文章历史版本:

修改次数:1 次 查看历史版本

相关推荐:

浅谈http断点续传的原理以及.NET代码实现,看似挺高端,其实很简单 C#高级编程(第10版)C# 6 & .NET Core 1.0 中文完整pdf扫描版[229MB]
从.NET+25台服务器支撑世界第54大网站浅谈网站优化 用C#实现求有向图的最长路径和最短路径
你写的Try...Catch真的有必要么? Resharper配合使用ProductivityPowerTools2017插件帮助你提高打码效率
ASP.NET Core中使用拦截器实现一个简单的web防火墙 Autofac在.NET Core中的属性注入
由double类型判等引发的一点小思考 .NET/java Office组件神器——Aspose.Total 17.x/18.x/19.x破解版+破解补丁下载

评论区: