3 ms·
// yy082 part 2 of 2 { if(videoid)fputc(yytext[c],stdout); } if(videoid)putchar(10); } \"videoId\":[ ]\"[^\"\12]+ { if(videoid)
by 1vuio0pswjnm7 3y ago
// yy082 part 2 of 2
{
if(videoid)fputc(yytext[c],stdout);
}
if(videoid)putchar(10);
}
\"videoId\":[ ]\"[^\"\12]+ {
if(videoid)
for(c=12;yytext[c]!=13&&yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=93&&yytext[c]!=125&&c<24;++c)
if(yytext[c]!=0)
{
if(videoid)fputc(yytext[c],stdout);
}
if(videoid)putchar(10);
}
"i.ytimg.com/vi/"[^\/]{11}\/[mh]qdefault.jpg {
if(videoid)
for(c=15;yytext[c]!=13&&yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=93&&yytext[c]!=125&&c<26;++c)
if(yytext[c]!=0)
{
if(videoid)fputc(yytext[c],stdout);
}
if(videoid)putchar(10);
}
/* --------------------- canonicalbaseurls ------------------------- */
\"canonicalBaseUrl\":\"\/@[^\"\12]+\" {
if(canonicalbaseurl)
{
for(c=20;yytext[c]!=32&&yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=92&&yytext[c]!=93&&yytext[c]!=125;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putc(10,stdout);
}
}
\"canonicalBaseUrl\":[ ]\"\/@[^\"\12]+\" {
if(canonicalbaseurl)
{
for(c=21;yytext[c]!=32&&yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=92&&yytext[c]!=93&&yytext[c]!=125;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putc(10,stdout);
}
}
/* ------------------------ channelids ------------------------------- */
\"channelId\":\"UC[^\"\12]+ {
if(channelid)
{
for(c=13;c!=yyleng+1;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
\"channelId\":[ ]\"UC[^\"\12]+ {
if(channelid)
{
for(c=14;c!=yyleng+1;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
\"browseId\":[ ]\"UC[^\"\12]+ {
if(channelid)
{
for(c=13;c!=yyleng+1;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
\"browseId\":\"UC[^\"\12]+ {
if(channelid)
{
for(c=12;c!=yyleng+1;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
,UC[^\"\12,]{22} {
if(channelid)
{
for(c=1;c!=yyleng+1;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
/* --------------------- tokens ---------------------- */
\"token\":[ ]\"[^\"\12]+ {
if(token)
{
for(c=10;yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=93&&yytext[c]!=125;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
\"continuationAction\":\"[^\"\12]+ {
if(token)
{
for(c=22;yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=93&&yytext[c]!=125;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
\"continuationCommand\":\{\"token\":\"[^\"\12]+ {
if(token)
{
for(c=32;yytext[c]!=34&&yytext[c]!=44&&yytext[c]!=93&&yytext[c]!=125;++c)
if(yytext[c]!=0)
fputc(yytext[c],stdout);
putchar(10);
}
}
.|\n
%%
int main(int argc,char* argv[]){
if((!argc)||(!argv[1]))goto help;
if((argv[1][0]!=98)&&
(argv[1][0]!=99)&&
(argv[1][0]!=104)&&
(argv[1][0]!=112)&&
(argv[1][0]!=116)&&
(argv[1][0]!=118))goto help;
if(argv[1][0]==98)canonicalbaseurl++;
if(argv[1][0]==99)channelid++;
if(argv[1][0]==104)http++;;
if(argv[1][0]==112)playlistid++;;
if(argv[1][0]==116)token++;;
if(argv[1][0]==118)videoid++;;
yylex();
exit(0);
help:
fputs("usage: yy082 {b,c,h,p,t,v}\12",stderr);
fputs("b canonicalBaseUrls\n",stderr);
fputs("c channelIds\n",stderr);
fputs("h watchUrls\n",stderr);
fputs("p playlistIds\n",stderr);
fputs("t continuation tokens\n",stderr);
fputs("v videoIds\n",stderr);
exit(1);
}