Skip to main content
deleted 28 characters in body
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228

Thanks for the tips everyone

I ended up doing this:

w3m -dump -T text/html "$thread" | grep -i -E -o 'File\:+([[:print:]]*)\.(jpg|png|webm|gif)'

w3m cleans the code and then iI can grep for the file names. (I need the literal "File:" part to distinguish a linked file from its title). I do need [[:print:]] because it catches most whitespace, unicode chars and other printables.

which works as I intended (though I still have to figure out how to prevent overwriting files with same name but that's another day's battle)

Thanks for the tips everyone

I ended up doing this:

w3m -dump -T text/html "$thread" | grep -i -E -o 'File\:+([[:print:]]*)\.(jpg|png|webm|gif)'

w3m cleans the code and then i can grep for the file names. (I need the literal "File:" part to distinguish a linked file from its title). I do need [[:print:]] because it catches most whitespace, unicode chars and other printables.

which works as I intended (though I still have to figure out how to prevent overwriting files with same name but that's another day's battle)

I ended up doing this:

w3m -dump -T text/html "$thread" | grep -i -E -o 'File\:+([[:print:]]*)\.(jpg|png|webm|gif)'

w3m cleans the code and then I can grep for the file names. (I need the literal "File:" part to distinguish a linked file from its title). I do need [[:print:]] because it catches most whitespace, unicode chars and other printables.

which works as I intended (though I still have to figure out how to prevent overwriting files with same name but that's another day's battle)

Source Link
CLos
  • 41
  • 1
  • 3

Thanks for the tips everyone

I ended up doing this:

w3m -dump -T text/html "$thread" | grep -i -E -o 'File\:+([[:print:]]*)\.(jpg|png|webm|gif)'

w3m cleans the code and then i can grep for the file names. (I need the literal "File:" part to distinguish a linked file from its title). I do need [[:print:]] because it catches most whitespace, unicode chars and other printables.

which works as I intended (though I still have to figure out how to prevent overwriting files with same name but that's another day's battle)