<commit_before>#!/bin/bash

url="$1"

html=$(wget -U Mozilla -q -O - "$url" | iconv -f GBK -t UTF8)
bookname=${html#*vt:\'}; bookname=${bookname%%\'*}
echo $bookname

function page() {
while read link title; do
  mkdir -p "$bookname/$title"
  html=$(wget -U Mozilla -q -O - "http://www.chuixue.net$link")
  packed=${html#*packed=\"}; packed=${packed%%\"*}
  all=$(node decode.js "$packed")

  i=1
  y=${all}<commit_msg>fix chuixue decode<commit_after>#!/bin/bash

url="$1"

html=$(wget -U Mozilla -q -O - "$url" | iconv -f GBK -t UTF8)
bookname=${html#*vt:\'}; bookname=${bookname%%\'*}
echo $bookname

function page() {
while read link title; do
  mkdir -p "$bookname/$title"
  html=$(wget -c -U Mozilla -q -O - "http://www.chuixue.net$link")
  isEncode=$(echo "$html" | grep packed)
  if [ "x$isEncode" != "x" ]; then
    packed=${html#*packed=\"}; packed=${packed%%\"*}
    all=$(node decode.js "$packed")
  else
    all=${html#*photosr}; all=${all%%script*}
  fi

  i=1
  y=${all}
{'fraction_non_alphanumeric': 0.24288617886178862, 'fraction_numerical': 0.006097560975609756, 'mean_word_length': 3.900497512437811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5787058', 'n_tokens_mistral': 399, 'n_tokens_neox': 379, 'n_words': 94}