Guest User

Untitled

a guest
Nov 24th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. echo "Looking for files that are not allowed"
  4. find -type f ! -name "*.[r0][0-9a][0-9r]" -a ! -name "*.[ns]f[ov]" -a ! -name "*.avi" -a ! -name "*.jpg" -a ! -name "*.vob" -a ! -name "*.png" -a ! -name "*.mkv"
  5. find -type f -name "imdb.nfo" -o -name "kolla.nfo" -o -name "mdb.nfo" -o -name "*(1)*" -o -name "*(2)*" -o -name "*bad-[0-9]*" -o -name "*~*"
  6. echo ""
  7.  
  8. echo "Looking for files with duplicate extentions"
  9. find -type f -name "*.avi.avi" -o -name "*.nfo.nfo" -o -name "*.sfv.sfv" -o -name "*.rar.rar"
  10. echo ""
  11.  
  12. echo "Looking for missing files or corrupt sfv"
  13. cfv -rimVV
  14. echo ""
  15.  
  16. echo "Looking for misplaced nfos"
  17. find -type f -name "*.nfo" ! -iname *fix* | grep CD[0-9]
  18. find -type f -name "*.nfo" ! -iname *fix* | grep -i sample
  19. echo ""
  20.  
  21. echo "Looking for nfo's that are too big"
  22. find -type f -name "*.nfo" -size +50k
  23. echo ""
  24.  
  25. echo "Looking for misplaced jpgs/pngs"
  26. find -type f -name "*.jpg" | egrep -vi 'sample|proof|cover'
  27. find -type f -name "*.png" | egrep -vi 'sample|proof|cover'
  28. echo ""
  29.  
  30. echo "Looking for jpgs/pngs that are too small"
  31. find -type f -name "*.jpg" -size -10k
  32. find -type f -name "*.png" -size -10k
  33. echo ""
  34.  
  35. echo "Looking for multiple nfo's or sfv's in same directory"
  36. find -type f -name "*.nfo" -printf "%h\n" | sort | uniq -c | sort | sed -e 's/^\ \+//' | grep -v ^1
  37. find -type f -name "*.sfv" -printf "%h\n" | sort | uniq -c | sort | sed -e 's/^\ \+//' | grep -v ^1
  38. echo ""
  39.  
  40. echo "Looking for missing nfo's"
  41. BASEDIR=`pwd`
  42. find -name "*.[r0][0a][r1]" -printf "%h\n" | egrep -vi 'subs|sample|cover|extra|proof' | sed -e 's/CD[0-9]$//' | sort -u | while read DIR
  43. do
  44. cd "$DIR"
  45. if ! [ -f *nfo ]
  46. then
  47. echo $DIR
  48. fi
  49. cd "$BASEDIR"
  50. done
  51. echo ""
  52.  
  53. echo "Looking for missing sfvs in subs dir"
  54. BASEDIR=`pwd`
  55. find -type d -iname *sub* | while read DIR
  56. do
  57. cd "$DIR"
  58. if [ ! -f *sfv ]
  59. then
  60. echo $DIR
  61. fi
  62. cd "$BASEDIR"
  63. done
  64. echo ""
  65.  
  66. echo "Looking for duplicate samples"
  67. BASEDIR=`pwd`
  68. find -type d -iname "*sample*" | while read DIR
  69. do
  70. cd "$DIR"
  71. if [ $(ls *avi | wc -l) -gt 1 ]
  72. then
  73. if [ "$(md5sum *avi | awk '{ print $1 }' | sort | uniq -cd)" != "" ]
  74. then
  75. echo $DIR
  76. fi
  77. fi
  78. cd "${BASEDIR}"
  79. done
  80. echo ""
  81.  
  82. echo "Looking for empty files/dirs"
  83. find -empty
  84. echo ""
  85.  
  86. echo "Looking for missing samples (movies may need to be added to ~/lists/repacks.txt)"
  87. BASEDIR=`pwd`
  88. find -name "*.[r0][0a][r1]" -printf "%h\n" | egrep -vi 'subs|subpack|fix|cover|sample|extra|proof' | sed -e 's/CD[0-9]//' | sed -e 's/^\.\///' -e 's/\/$//' | sort -u | while read DIR
  89. do
  90. if ! grep -q "$DIR" ~/lists/repacks.txt
  91. then
  92. cd "$DIR"
  93. if [ ! -d Sample ]
  94. then
  95. echo "$DIR"
  96. fi
  97. cd "${BASEDIR}"
  98. fi
  99. done
  100. echo ""
  101.  
  102. echo "Looking for misplaced samples"
  103. find -type f -name "*.avi" | egrep -vi 'sample|proof'
  104. echo ""
  105.  
  106. echo "Looking for misnamed CD directories"
  107. find -type d | grep -i cd[0-9] | grep -v CD
  108. echo ""
  109.  
  110. echo "Counting number of files versus sfv per directory"
  111. BASEDIR=`pwd`
  112. find -name "*sfv" -printf "%h\n" | while read DIR
  113. do
  114. cd "$DIR"
  115. NUMFILESDIR=`find -maxdepth 1 -mindepth 1 -type f | egrep -v 'sfv$|nfo$' | wc -l`
  116. NUMFILESSFV=`cat *sfv | grep ^\[0-9a-zA-Z] | wc -l`
  117. if [ $NUMFILESDIR -ne $NUMFILESSFV ]
  118. then
  119. echo "$DIR (DIR: $NUMFILESDIR - SFV: $NUMFILESSFV)"
  120. fi
  121. cd "$BASEDIR"
  122. done
  123. echo ""
  124.  
  125. echo "Looking for corrupt samples"
  126. find -type f -name "*.avi" -exec ln -s `pwd`/{} ~/.wine/drive_c \;
  127. wine c:\AVIMAster.exe c:\*.avi > samples.log
  128. echo ""
  129. fromdos samples.log
  130. cat -A samples.log | sed -e 's/\$$//' > 1
  131. mv 1 samples.log
  132. grep -B60 Error samples.log | grep -i ^C\: | sed -e 's/C\:\\//i' | sort
  133. rm ~/.wine/drive_c/*.avi
  134. rm samples.log
  135. echo ""
Add Comment
Please, Sign In to add comment