<commit_before>#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>

#include "lib/cre_consts.h"
#include "lib/cre_limits.h"
#include "lib/strsplit.h"
#include "lib/download_url_buffer.h"
#include "lib/download_url_file.h"
#include "lib/get_links.h"

#define MIN(a,b) (((a)<(b))?(a):(b))

char* name_from_url(char* url) {
  char* parts[MAXPARTS];
  char *s = strdup(url);
  int len = strsplit(s, parts, "/");
  return parts[len -1];
}


void download_episode(char* url) {
  FILE *fp;
  char cwd[MAXPATH];
  char full_path[MAXPATH];
  char *name = name_from_url(url);

  getcwd(cwd, sizeof(cwd));
  sprintf(full_path, "%s/casts/%s.mp3", cwd, name);

  printf("downloading: %s to %s\n", url, full_path);

  fp = fopen(full_path, "w");<commit_msg>correcting duplicate .mp3 in filename<commit_after>#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>

#include "lib/cre_consts.h"
#include "lib/cre_limits.h"
#include "lib/strsplit.h"
#include "lib/download_url_buffer.h"
#include "lib/download_url_file.h"
#include "lib/get_links.h"

#define MIN(a,b) (((a)<(b))?(a):(b))

char* name_from_url(char* url) {
  char* parts[MAXPARTS];
  char *s = strdup(url);
  int len = strsplit(s, parts, "/");
  return parts[len -1];
}

void download_episode(char* url) {
  FILE *fp;
  char cwd[MAXPATH];
  char full_path[MAXPATH];
  char *name = name_from_url(url);

  getcwd(cwd, sizeof(cwd));
  sprintf(full_path, "%s/casts/%s", cwd, name);

  printf("downloading: %s to %s\n", url, full_path);

  fp = fopen(full_path, "w");
{'fraction_non_alphanumeric': 0.19262038774233897, 'fraction_numerical': 0.0025015634771732333, 'mean_word_length': 5.106870229007634, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '426825', 'n_tokens_mistral': 688, 'n_tokens_neox': 672, 'n_words': 137}