I bypassed these downloading issues by doing a manual download.
First (Download): try manually downloading the AFINN-111 document, currently at http://www2.imm.dtu.dk/pubdb/pubs/6010-full.html or simply do a web search. This will Download the imm6010.zip file, which is what the textdata library package is specifically seeking to access the AFINN-111 text document.
Second (Identify AFINN directory): go to the R terminal, enter
library(textdata)
textdata::lexicon_afinn(manual_download = TRUE)
The code will push a warning "cannot open zip file 'C:/path/to/afinn/directory...imm6010.zip'
Third (Move file to AFINN directory): move the imm6010.zip file from your download directory to the textdata afinn directory (given by the previous warning). One way of accomplishing the task, open bash (Unix shell) and enter the following:
mv /your/path/from/download_directory/ /your/path/to/textdata/afinn_directory/
Then retry the R code:
textdata::lexicon_afinn(manual_download = TRUE)
If imm6010.zip is copied to the correct path, textdata will then have access to the AFINN-111.txt document and the function you were having trouble with, get_sentiments("afinn") will work.
Fourth (check headers). That is the newer afinn text document has replaced the "score" header with the term "value" so be sure to update your R code, if the following warning is given:
"The following named parsers don't match the column names: score"