我正在尝试通过 youtube-dl 为 youtube 播放列表中的所有视频下载 json 元数据(不是视频)。我还想在再次运行相同的命令时忽略为播放列表中的视频下载已下载的 json 元数据。所以,这是我尝试过的命令,
youtube-dl -i --write-info-json --skip-download --download-archive archive.txt {youtube-playlist-url}
Run Code Online (Sandbox Code Playgroud)
--write-info-json写入视频 info.json
--skip-download不下载视频
--download-archive archive.txt archive.txt 包含已下载视频 ID 的列表,因此 youtube-dl 不会再次下载这些视频
但是,将 --skip-download 参数包含到 youtube-dl 会导致视频 ID 未添加到 archive.txt,这表明 yt-dl 仅在下载视频后将视频 ID 添加到 archive.txt。这两个命令(--skip-download & --download-archive archive.txt)可以一起运行吗?或者有没有其他方法可以实现它?
//linked list implementation
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node* link;
};
struct node* head;
void insert(int);
void print();
int main()
{
head=NULL;
int n,i,x;
printf("\nEnter the number of elements :");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter the element :");
scanf("%d",&x);
insert(x);
print();
}
}
void insert(int x)
{
struct node* temp=(node*)malloc(sizeof(struct node));
temp->data=x;
temp->link=head;
head=temp;
}
void print()
{
struct node* temp=head;
int i=0;
printf("\nThe list is ");
while(temp!=NULL)
{
printf("%d ",temp->data);
temp=temp->link;
}
printf("\n");
}
Run Code Online (Sandbox Code Playgroud)
在编译代码时:
In function …Run Code Online (Sandbox Code Playgroud) 我想以特定的 ISO 8601 格式格式化 UTC 日期时间,例如2020-02-28T14:10:23+00:00但不是2020-02-28T14:10:23Z。我不想要 Z 最后而是 +00:00。我尝试了simpleDateFormat doc 中的所有格式,但似乎没有提供上述格式的格式。
我知道无论格式如何,两者都表示相同的时间,但出于向后兼容性的原因,它需要像那样格式化。
这是我尝试过的java代码,
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.println(sdf.format(new Date()));
Run Code Online (Sandbox Code Playgroud)
可以通过在格式化字符串中用 +00:00 替换 z 来实现,但这似乎不是一个好的选择。
--To check the list is in ascending order or not
ascending::[Int]->Bool
ascending [] =True
ascending ((length l) == 1) =True
ascending l =((head l)<=l !! 1) && ascending(tail l)
Run Code Online (Sandbox Code Playgroud)
这是我的Haskell代码,当我尝试在GHCI解释器中运行此代码时,我收到以下错误:
ascending.hs(File_name):4:13: Parse error in pattern: length
Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)
谁能告诉我这个bug在哪里?