Skip to content

Instantly share code, notes, and snippets.

@usaturn
Last active February 20, 2022 23:25
Show Gist options
  • Select an option

  • Save usaturn/8937711 to your computer and use it in GitHub Desktop.

Select an option

Save usaturn/8937711 to your computer and use it in GitHub Desktop.
#!/usr/bin/awk -rf
BEGIN{
url_list="url_list"
while (getline < url_list > 0) {
flvname=gensub(/^(http.+)\.flv.+/, "\\1", 1, $0)
if(flvname in flv) true
else {
flv[flvname]++
}
}
close(url_list)
}
/^http:.+\.flv/ {
flvname=gensub(/^(http.+)\.flv.+/, "\\1", 1, $0)
if(flvname in flv) next
else {
url[$1]
flv[flvname]++
}
}
END{
print strftime("%Y/%m/%d %H:%M:%S", systime()) >> url_list
for(i in url) print i >> url_list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment