前言
OneDriver都知道,是微软旗下的一款网盘,平常只能用来存东西用,但是他还能不一样一点,转换成直链,当成图床视频床使用
OneDriver直链转换
原链接:
https://前缀-my.sharepoint.com/:字母:/g/personal/账户名/文件地址
三种直链方式
https://前缀-my.sharepoint.com/personal/账户名/Documents/文件地址(带后缀)
这种方式有一个坏处就是只要你的文件移动了位置,比如把图片A从文件夹B移动到文件夹C里面的话,要是还是用之前文件还在文件夹A里面的时候的链接的话,那么地址就会失效,而且也有可能要查看文件时得登录才能查看
简单来说,就是用此链接之后,就不能轻易改动文件位置,否则就会导致文件失效
https://前缀-my.sharepoint.com/personal/账户名/_layouts/52/download.aspx?share=分享链接(就是账户名之后的一段字符串)
这一种比上面的更好一点,至少更改图片位置不会影响链接
https://前缀-my.sharepoint.com/:字母:/g/personal/账户名/分享链接?download=1
重定向跳转至链接
C语言链接替换脚本
仅对文件可用,文件夹使用则失效
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
| #include <stdio.h> #include <string.h>
void qianzhui(char yuan_lian[], char qian_zhui[]);
void zhanghu(char yuan_lian[], char zhang_hu[]);
void dizhi(char yuan_lian[], char di_zhi[]);
int main() { while (1) { char yuan_lian[300]; printf("请输入原链接:"); gets(yuan_lian); printf("\n");
char qian_zhui[10]; qianzhui(yuan_lian, qian_zhui);
char zhang_hu[100]; zhanghu(yuan_lian, zhang_hu);
char di_zhi[100]; dizhi(yuan_lian, di_zhi);
printf("直链:https://%s-my.sharepoint.com/personal/%s/_layouts/52/download.aspx?share=%s\n\n", qian_zhui, zhang_hu, di_zhi); } }
void dizhi(char yuan_lian[], char di_zhi[]) { char temp[] = "_com/"; int num = sizeof(temp) / sizeof(char); char temp_2[num]; int i = 0, d, j; while (yuan_lian[i] != '\0') { d = i; for (j = 0; j < num - 1; ++j) { temp_2[j] = yuan_lian[d]; d++; } temp_2[j] = '\0'; if (strcmp(temp_2, temp) == 0) { break; } i++; }
int q = 0; while (yuan_lian[d] != '\0') { di_zhi[q] = yuan_lian[d]; d++; q++; } di_zhi[q] = '\0'; }
void zhanghu(char yuan_lian[], char zhang_hu[]) { char temp[] = "personal/"; int num = sizeof(temp) / sizeof(char); char temp_2[num]; int i = 0, d, j; while (yuan_lian[i] != '\0') { d = i; for (j = 0; j < num - 1; ++j) { temp_2[j] = yuan_lian[d]; d++; } temp_2[j] = '\0'; if (strcmp(temp_2, temp) == 0) { break; } i++; }
int q = 0; while (yuan_lian[d] != '/') { zhang_hu[q] = yuan_lian[d]; d++; q++; } zhang_hu[q] = '\0'; }
void qianzhui(char yuan_lian[], char qian_zhui[]) { int i = 0; char temp = yuan_lian[0]; while (yuan_lian[i] != '\0') { temp = yuan_lian[i]; i++; if (temp == '/' && yuan_lian[i] == '/') { break; } } i++; int j = 0; while (yuan_lian[i] != '-') { qian_zhui[j++] = yuan_lian[i]; i++; } qian_zhui[j] = '\0'; }
|
下载
编译好的文件:点击下载