小编Aji*_*kar的帖子

youtube-dl:通过忽略在 archive.txt 中指定的视频,在播放列表中下载 youtube 视频 info.json

我正在尝试通过 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)可以一起运行吗?或者有没有其他方法可以实现它?

youtube-dl

3
推荐指数
1
解决办法
4649
查看次数

这个c代码(链表实现)有什么问题?

 //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)

c linked-list singly-linked-list

1
推荐指数
1
解决办法
133
查看次数

如何在 Java 中将 UTC 日期时间转换为 ISO 8601 格式?

我想以特定的 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 来实现,但这似乎不是一个好的选择。

java datetime iso8601 datetime-format

1
推荐指数
1
解决办法
1177
查看次数

获取错误"模式中的解析错误:长度失败,模块已加载:无"

 --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在哪里?

haskell parse-error

-1
推荐指数
1
解决办法
464
查看次数